AutoCorrect Markdown Check #92
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 * * 0" | |
jobs: | |
autocorrect: | |
name: Check and Auto-fix Markdown Formatting | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
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 . | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | |
body: fix typo via autocorrect and perttier | |
branch: fix-typo | |
commit-message: "fix(typo): fix typo" | |
committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | |
labels: typo | |
sign-commits: true | |
title: "fix(typo): automatic fix typo" |