diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 063d3e713e..96ba351c31 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -583,18 +583,15 @@ 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 }} run: | - # Use PAT for pushing - git remote set-url origin https://$GITHUB_TOKEN@github.com/${{ github.event.pull_request.head.repo.full_name }}.git - git fetch origin ${{ env.PR_BRANCH }} - git checkout ${{ env.PR_BRANCH }} + git fetch origin ${{ github.head_ref }} + git checkout ${{ github.head_ref }} 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]" - git push origin HEAD:${{ env.PR_BRANCH }} + git push origin HEAD:${{ github.head_ref }} else echo "No changes to commit" fi