AutoCorrect Markdown Check #68
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: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
autocorrect: | |
name: Check and Auto-fix Markdown Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
- name: Install and run format | |
run: | | |
# 安装 autocorrect | |
curl -sSL https://raw.githubusercontent.com/huacnlee/autocorrect/main/install | sh | |
# 修复文件格式 | |
autocorrect --fix | |
# 安装并运行 prettier | |
npm install -g prettier | |
prettier --write . | |
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 "fix(typo): Fix Markdown formatting" | |
git push origin HEAD:main |