File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
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 :
@@ -27,18 +28,18 @@ jobs:
2728 run : npm install -g markdownlint-cli
2829
2930 - name : Lint and Fix Markdown files
30- run : markdownlint '**/*.md' --fix --config .github/.markdownlint.json
31+ run : markdownlint '**/*.md' --fix --config .github/.markdownlint.json
3132
3233 - name : Configure Git
3334 run : |
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