Update README.md #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: AutoCorrect Markdown Check | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
autocorrect: | |
name: Check and Auto-fix Markdown Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install and run AutoCorrect | |
run: | | |
curl -sSL https://raw.githubusercontent.com/huacnlee/autocorrect/main/install | sh | |
autocorrect --fix | |
# 检查是否有文件更改 | |
- name: Check for changes | |
run: git diff --exit-code || git status | |
# 如果有更改,则配置 Git 提交用户名和邮箱,并提交更改 | |
- name: Commit changes | |
if: success() || failure() # 确保失败时继续 | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "AutoCorrect: Fix Markdown formatting" | |
git push | |
continue-on-error: true # 即使没有更改也不影响其他步骤 |