mirror of
https://github.com/DavidAnson/markdownlint-cli2-action.git
synced 2024-12-22 21:03:53 +01:00
Add example workflow demonstrating linting only changed files (closes #12).
This commit is contained in:
parent
f9beccb1a4
commit
5886d8c11c
2 changed files with 23 additions and 0 deletions
18
.github/workflows/changed.yml
vendored
Normal file
18
.github/workflows/changed.yml
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 2
|
||||
- uses: tj-actions/changed-files@v24
|
||||
id: changed-files
|
||||
with:
|
||||
files: '**/*.md'
|
||||
separator: "\n"
|
||||
- uses: DavidAnson/markdownlint-cli2-action@v6
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
with:
|
||||
globs: ${{ steps.changed-files.outputs.all_changed_files }}
|
|
@ -97,6 +97,11 @@ To prevent linting issues from failing the workflow run:
|
|||
See [`example.yml`][example-yml] for a simple GitHub workflow that uses
|
||||
`markdownlint-cli2-action`.
|
||||
|
||||
See [`changed.yml`][changed-yml] for a GitHub workflow that lints only the
|
||||
Markdown files that changed in the most recent commit (useful for Pull
|
||||
Requests and/or gradually introducing linting rules to a new repository).
|
||||
|
||||
[changed-yml]: .github/workflows/changed.yml
|
||||
[command-line]: https://github.com/DavidAnson/markdownlint-cli2#command-line
|
||||
[commonmark]: https://commonmark.org/
|
||||
[example-yml]: .github/workflows/example.yml
|
||||
|
|
Loading…
Reference in a new issue