Create Markdownlint auto-fix PR #365
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: Create Markdownlint auto-fix PR | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
fix: | |
if: github.repository == 'mdn/content' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: ".nvmrc" | |
cache: yarn | |
- name: Install all yarn packages | |
env: | |
HUSKY: 0 | |
run: yarn --frozen-lockfile | |
- name: Lint markdown files | |
run: yarn fix:md | |
- name: Create PR with only fixable issues | |
if: success() | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
commit-message: "chore: auto-fix Markdownlint issues" | |
branch: markdownlint-auto-cleanup | |
title: "Markdownlint auto-cleanup" | |
author: mdn-bot <[email protected]> | |
body: | | |
All issues auto-fixed | |
token: ${{ secrets.AUTOMERGE_TOKEN }} | |
- name: Create PR with notice on unfixed issues | |
if: failure() | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
commit-message: "chore: auto-fix Markdownlint issues" | |
branch: markdownlint-auto-cleanup | |
title: "Markdownlint auto-cleanup" | |
author: mdn-bot <[email protected]> | |
body: | | |
Auto-fix was run, but additional issues found. | |
Please review the run log: https://github.com/mdn/content/actions/runs/${{ github.run_id }} | |
token: ${{ secrets.AUTOMERGE_TOKEN }} |