@@ -506,7 +506,7 @@ jobs:
506
506
repository : ${{ github.event.pull_request.head.repo.full_name }}
507
507
ref : ${{ github.event.pull_request.head.ref }}
508
508
fetch-depth : 0 # Required for getting full git history
509
- token : ${{ secrets.GITHUB_TOKEN }}
509
+ PAT : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
510
510
511
511
- name : Setup Node.js
512
512
uses : actions/setup-node@v4
@@ -562,8 +562,8 @@ jobs:
562
562
563
563
- name : Setup Git Config
564
564
run : |
565
- git config user.name "GitHub Actions Bot "
566
- git config user.email "41898282+ github-actions[bot]@users.noreply.github.com "
565
+ git config --local user.email "github-actions[bot]@users.noreply.github.com "
566
+ git config --local user.name " github-actions[bot]"
567
567
568
568
- name : Debug GitHub Variables
569
569
run : |
@@ -583,21 +583,19 @@ jobs:
583
583
env :
584
584
PR_BRANCH : ${{ github.event.pull_request.head.ref }}
585
585
PR_REPO : ${{ github.event.pull_request.head.repo.full_name }}
586
- GITHUB_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
586
+ PAT : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
587
587
run : |
588
- set -e # Exit on error
589
- git remote set-url origin "https://[email protected] /$PR_REPO.git"
590
- git fetch origin "$PR_BRANCH"
591
- git checkout "$PR_BRANCH"
588
+ # Set the remote URL with PAT for authentication
589
+ git remote set-url origin https://${PAT}@github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}.git
590
+
592
591
git add docs/docs/auto-docs/
593
592
git add docs/docs/developer-guide/
594
593
git add docs/docs/user-guide/
594
+
595
595
if [[ -n "$(git status --porcelain)" ]]; then
596
596
git commit -m "docs: update auto-generated documentation [skip ci]"
597
- if ! git push origin "HEAD:$PR_BRANCH"; then
598
- echo "Failed to push changes"
599
- exit 1
600
- fi
597
+ # Use PAT in the push command
598
+ git push "https://${PAT}@github.com/${{ github.event.pull_request.head.repo.full_name }}.git" HEAD:${{ github.head_ref }}
601
599
else
602
600
echo "No changes to commit"
603
601
fi
0 commit comments