diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 5093a6abc8..1fafeade54 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -578,18 +578,19 @@ jobs: - name: Check and Commit Documentation run: | - # Check if there are any changes + # Checkout the PR branch using the dynamic reference + git fetch origin ${{ github.head_ref }} + git checkout ${{ github.head_ref }} + + # Add all the generated documentation files + git add docs/docs/auto-docs/ + git add docs/docs/developer-guide/ + git add docs/docs/user-guide/ + + # Commit if there are changes if [[ -n "$(git status --porcelain)" ]]; then - # Add all changes - git add docs/docs/auto-docs - git add docs/docs/user-guide - git add docs/docs/developer-guide - - # Commit changes git commit -m "docs: update auto-generated documentation [skip ci]" - - # Push changes - git push + git push origin ${{ github.head_ref }} else echo "No changes to commit" fi