diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index bccd281043..5b849f566c 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -506,7 +506,7 @@ jobs: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 0 # Required for getting full git history - token: ${{ secrets.GITHUB_TOKEN }} + PAT: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: Setup Node.js uses: actions/setup-node@v4 @@ -562,8 +562,8 @@ jobs: - name: Setup Git Config run: | - git config user.name "GitHub Actions Bot" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" - name: Debug GitHub Variables run: | @@ -583,21 +583,19 @@ jobs: env: PR_BRANCH: ${{ github.event.pull_request.head.ref }} PR_REPO: ${{ github.event.pull_request.head.repo.full_name }} - GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + PAT: ${{ secrets.PERSONAL_ACCESS_TOKEN }} run: | - set -e # Exit on error - git remote set-url origin "https://$GITHUB_TOKEN@github.com/$PR_REPO.git" - git fetch origin "$PR_BRANCH" - git checkout "$PR_BRANCH" + # Set the remote URL with PAT for authentication + git remote set-url origin https://${PAT}@github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}.git + git add docs/docs/auto-docs/ git add docs/docs/developer-guide/ git add docs/docs/user-guide/ + if [[ -n "$(git status --porcelain)" ]]; then git commit -m "docs: update auto-generated documentation [skip ci]" - if ! git push origin "HEAD:$PR_BRANCH"; then - echo "Failed to push changes" - exit 1 - fi + # Use PAT in the push command + git push "https://${PAT}@github.com/${{ github.event.pull_request.head.repo.full_name }}.git" HEAD:${{ github.head_ref }} else echo "No changes to commit" fi