Skip to content

Commit 6d6f558

Browse files
authored
multiple pipelines
1 parent 1f3a0ae commit 6d6f558

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/validate_and_fix_markdown.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: write
10+
pull-requests: write
1011

1112
jobs:
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"

0 commit comments

Comments
 (0)