Skip to content

Commit ab6e1ce

Browse files
authored
Merge pull request #35 from shiquda/main
feat: 使用Actions自动格式化markdown文档
2 parents 17b5350 + 8531067 commit ab6e1ce

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/prettier-check.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,19 @@ jobs:
3939
if: failure()
4040
run: |
4141
echo "The following Markdown files are not properly formatted:"
42-
prettier --list-different --write "**/*.md"
42+
prettier --list-different "**/*.md"
43+
44+
# Step 6: try auto fix
45+
- name: Auto Fix
46+
if: failure()
47+
run: |
48+
prettier --write "**/*.md"
49+
50+
- name: Commit and Push
51+
if: failure()
52+
run: |
53+
git config --global user.email "action@github.com"
54+
git config --global user.name "GitHub Action"
55+
git add .
56+
git commit -m "Fix markdown formatting"
57+
git push

0 commit comments

Comments
 (0)