File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 77
88permissions :
99 contents : write
10+ pull-requests : write
1011
1112jobs :
1213 validate-and-fix-markdown :
@@ -34,11 +35,11 @@ jobs:
3435 git config --global user.email "github-actions[bot]@users.noreply.github.com"
3536 git config --global user.name "github-actions[bot]"
3637
37- - name : Commit changes
38+ - name : Commit and rebase changes
39+ env :
40+ PR_BRANCH : ${{ github.head_ref || github.ref_name }}
3841 run : |
39- git fetch origin
40- git checkout -b ${{ github.event.pull_request.head.ref }} origin/${{ github.event.pull_request.head.ref }}
4142 git add -A
4243 git commit -m "Fix Markdown syntax issues" || echo "No changes to commit"
43- git pull --rebase origin ${{ github.event.pull_request.head.ref }} || echo "No rebase needed"
44- git push origin HEAD:${{ github.event.pull_request.head.ref }}
44+ git pull --rebase origin "$PR_BRANCH" || echo "No rebase needed"
45+ git push origin HEAD:"$PR_BRANCH"
You can’t perform that action at this time.
0 commit comments