diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 30fd2dfce5..fa46ecc5a6 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -503,7 +503,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.ref }} + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 # Required for getting full git history token: ${{ secrets.GITHUB_TOKEN }} @@ -579,7 +579,11 @@ jobs: git status - name: Check and Commit Documentation + env: + PR_BRANCH: ${{ github.event.pull_request.head.ref }} + PR_REPO: ${{ github.event.pull_request.head.repo.full_name }} run: | + git remote add fork https://github.com/$PR_REPO.git # Add all the generated documentation files git add docs/docs/auto-docs/ git add docs/docs/developer-guide/ @@ -588,7 +592,7 @@ jobs: # Commit if there are changes if [[ -n "$(git status --porcelain)" ]]; then git commit -m "docs: update auto-generated documentation [skip ci]" - git push origin HEAD: ${{ github.event.pull_request.head.ref }} + git push fork HEAD:$PR_BRANCH else echo "No changes to commit" fi