-
Notifications
You must be signed in to change notification settings - Fork 22
60 lines (49 loc) · 1.7 KB
/
markdown-checks.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Markdown linter
# What the execution context is:
# The creation of a pull request. Can also be triggered manually.
# What it does:
# Performs Markdown linting on the content of the pull request.
# Why we need it:
# To maintain a level of consistency in the markup content.
# What's important to know:
# As well as the rules defined in the configuration, a custom
# rule is also employed to check title case.
on:
workflow_dispatch:
pull_request:
branches: [main]
paths: 'docs/**'
jobs:
main:
if: contains(github.repositoryUrl, 'github.com')
runs-on: ubuntu-20.04
steps:
- id: checkout_repo
name: Check out the repository content
uses: actions/checkout@v2
- id: check_files_changed
uses: dorny/paths-filter@v2
with:
list-files: 'escape'
filters: |
changed:
- 'docs/**'
- id: add_matcher
name: Add the matcher for markdownlint style message output
run: "echo ::add-matcher::.github/workflows/markdownlint/problem-matcher.json"
- id: install_linter
name: Install linting tool, custom rule and rule helpers
run: |
npm install \
--no-package-lock \
--no-save \
[email protected] markdownlint-rule-titlecase [email protected]
- id: run_linter
if: steps.check_files_changed.outputs.changed_files
name: Run linter with specific rules, on the docs/ content
run: |
npx markdownlint \
--config .github/workflows/markdownlint/config.yaml \
--rules .github/workflows/markdownlint/md901 \
--rules markdownlint-rule-titlecase \
${{ steps.check_files_changed.outputs.changed_files }}