Skip to content

Commit 33ec57c

Browse files
committed
Implements -f in action to auto-fix small md errors
1 parent 2152882 commit 33ec57c

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/lint.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
branches:
99
- main
1010

11+
permissions:
12+
contents: write
13+
1114
jobs:
1215
lint:
1316
runs-on: ubuntu-latest
@@ -28,4 +31,20 @@ jobs:
2831
if: steps.changed-files.outputs.any_changed == 'true'
2932
with:
3033
globs: ${{ steps.changed-files.outputs.all_changed_files }}
31-
separator: ","
34+
separator: ","
35+
fix: true
36+
37+
# Check if anything was fixed, then Commit & Push
38+
- name: Commit and push fixes
39+
if: always() && steps.changed-files.outputs.any_changed == 'true'
40+
run: |
41+
# Configure the bot's identity
42+
git config --global user.name "github-actions[bot]"
43+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
44+
45+
# Check if the linter modified any files
46+
if [[ -n $(git status -s) ]]; then
47+
git add .
48+
git commit -m "style: auto-fix markdown formatting"
49+
git push
50+
fi

0 commit comments

Comments
 (0)