Skip to content

Markdown check workflow #12

Markdown check workflow

Markdown check workflow #12

Workflow file for this run

name: Markdown Checks
on:
pull_request:
branches:
- main
jobs:
markdown_checks:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: |
npm install markdownlint-cli markdown-spellcheck markdown-link-check
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b /usr/local/bin
- name: Run Markdown linter
run: |
npx markdownlint '**/*.md' --config .markdownlint.yaml --ignore 'node_modules/**' \
| reviewdog -efm="%f:%l:%c %m" -efm="%f:%l %m" -name="markdownlint" -reporter=github-pr-review
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run spell checker
run: |
npx markdown-spellcheck '**/*.md' --ignore 'node_modules/**' --en-us -r -x -a > markdown-spellcheck.txt
if [ $? -ne 0 ]; then
cat markdown-spellcheck.txt | gh pr comment ${{ github.event.pull_request.number }}
fi
- name: Run link checker
run: |
find . -name "*.md" -not -path "./node_modules/*" -not -path "./.github/*" -exec npx markdown-link-check -q {} + > markdown-link-check.txt
if [ -s markdown-link-check.txt ]; then
cat markdown-link-check.txt | gh pr comment ${{ github.event.pull_request.number }}
fi