Check Markdown #339
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: Check Markdown | |
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows | |
on: | |
push: | |
paths: | |
- ".github/workflows/check-markdown.yml" | |
- ".markdown-link-check.json" | |
- "**/.markdownlint*" | |
- "**.md" | |
- "**.mdx" | |
- "**.mkdn" | |
- "**.mdown" | |
- "**.markdown" | |
pull_request: | |
paths: | |
- ".github/workflows/check-markdown.yml" | |
- ".markdown-link-check.json" | |
- "**/.markdownlint*" | |
- "**.md" | |
- "**.mdx" | |
- "**.mkdn" | |
- "**.mdown" | |
- "**.markdown" | |
schedule: | |
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to markdownlint. | |
- cron: "0 8 * * TUE" | |
workflow_dispatch: | |
repository_dispatch: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initialize markdownlint-cli problem matcher | |
uses: xt0rted/markdownlint-problem-matcher@v3 | |
- name: Install markdownlint-cli | |
run: sudo npm install --global markdownlint-cli | |
- name: Run markdownlint | |
run: markdownlint "**/*.md" | |
links: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Determine whether only modified files should be checked | |
id: check-modified | |
if: github.event_name == 'pull_request' | |
run: | | |
echo "::set-output name=value::yes" | |
- name: Check links | |
uses: gaurav-nelson/github-action-markdown-link-check@v1 | |
with: | |
config-file: .markdown-link-check.json | |
use-quiet-mode: "yes" | |
check-modified-files-only: ${{ steps.check-modified.outputs.value }} | |
base-branch: ${{ github.base_ref }} |