The markdown-lint
reusable action is located at .github/workflows/markdown-lint.yml
.
This workflow will use the markdownlint-cli
to lint markdown files in the target repository. You can use the paths
filter to only trigger this workflow for specific files or file patterns. More on this in the usage section.
This reusable action depends on the following actions:
The action has the following inputs:
Specify the target repository this action should run on. This is used to prevent actions from running on repositories other than the target repository. For example, specifying a target-repo
of mdn/workflows
will prevent the action from running on forks of mdn/workflows
.
- This
input
is required
The node version to setup and use.
- This
input
is optional, with a default of20
.
Which package manager cache to use.
- This
input
is optional, with a default of yarn.
name: markdown-lint
on:
pull_request:
branches:
- main
paths:
- "*.md"
- .github/workflows/markdown-lint.yml
jobs:
markdown-lint:
uses: mdn/workflows/.github/workflows/markdown-lint.yml@main
with:
target-repo: "mdn/workflows"
Above you can see how the paths
filter is being used to specify specific files and file patterns.
name: markdown-lint
on:
pull_request:
branches:
- main
paths:
- "*.md"
- .github/workflows/markdown-lint.yml
jobs:
markdown-lint:
uses: mdn/workflows/.github/workflows/markdown-lint.yml@main
with:
cache: "npm"
node-version: 20
target-repo: "mdn/workflows"