adding different method for changed files

This commit is contained in:
2025-08-11 15:24:27 +00:00
parent 2622b66cee
commit bc7054837d

View File

@ -124,6 +124,7 @@ jobs:
print(doc_exports_var)
json_str = json.dumps(doc_exports_var, indent=4)
json_str = "doc_exports_var=" + json_str
print(json_str)
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
fh.write(json_str)
@ -136,17 +137,47 @@ jobs:
ls -la ./doc_exports_var.json
cat ./doc_exports_var.json
- name: Get last git changed files
id: git_log
# - name: Get last git changed files
# id: git_log
# run: |
# cd $PROJECT_SRC_DIR
# ls
# echo > ../changed_files.txt
# git branch
# git status
# git log -1 --name-only --pretty= > ../changed_files.txt || true
# cat ../changed_files.txt
# cat ../doc_exports_var.json
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Debug event file
run: |
cd $PROJECT_SRC_DIR
ls
echo > ../changed_files.txt
git branch
git status
git log -1 --name-only --pretty= > ../changed_files.txt || true
cat ../changed_files.txt
cat ../doc_exports_var.json
echo "Gitea event file path: $GITEA_EVENT_PATH"
cat "$GITEA_EVENT_PATH"
- name: List changed files in PR
id: changed_files
run: |
PR_NUMBER=$(jq -r .pull_request.number "$GITEA_EVENT_PATH")
REPO=$(jq -r .repository.full_name "$GITEA_EVENT_PATH")
echo "PR #$PR_NUMBER from repo $REPO"
# Extract owner and repo name
OWNER=$(echo "$REPO" | cut -d'/' -f1)
REPO_NAME=$(echo "$REPO" | cut -d'/' -f2)
# Use Gitea API to get changed files
# Requires an API token with repo read access
curl -s -H "Authorization: token ${{ secrets.TEST_TOKEN }}" \
"https://gitea.eco.tsi-dev.otc-service.com/api/v1/repos/$OWNER/$REPO_NAME/pulls/$PR_NUMBER/files" \
| jq -r '.[].filename' > changed_files.txt
echo "Changed files:"
cat changed_files.txt
- name: Generate RST docs
run: |