Skip to content

Commit c5fc7ba

Browse files
soumeh01VladimirUmek
authored andcommitted
Markdown linting and link check
1 parent 5670b41 commit c5fc7ba

4 files changed

Lines changed: 86 additions & 0 deletions

File tree

.github/markdown-link-check.jsonc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"httpHeaders": [
3+
{
4+
"urls": ["https://github.com/", "https://guides.github.com/", "https://help.github.com/", "https://docs.github.com/"],
5+
"headers": {
6+
"Accept-Encoding": "zstd, br, gzip, deflate"
7+
}
8+
}
9+
],
10+
}

.github/markdownlint.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "markdownlint",
5+
"severity": "warning",
6+
"pattern": [
7+
{
8+
"regexp": "^(.*):(\\d+)(:(\\d+))? (MD\\d+\\/[^ ]+) (.*)$",
9+
"file": 1,
10+
"line": 2,
11+
"column": 4,
12+
"code": 5,
13+
"message": 6
14+
}
15+
]
16+
}
17+
]
18+
}

.github/markdownlint.jsonc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"default": true,
3+
"MD013": {
4+
"line_length": 120
5+
},
6+
"MD014": false,
7+
"MD029": false,
8+
"MD025": false,
9+
"MD034": false,
10+
"MD041": false
11+
}

.github/workflows/markdown.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: markdown
2+
on:
3+
pull_request:
4+
paths:
5+
- '.github/workflows/markdown.yml'
6+
- '.github/markdownlint.json'
7+
- '.github/markdownlint.jsonc'
8+
- '.github/markdown-link-check.jsonc'
9+
- '**/*.md'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
# Declare default permissions as read only.
16+
permissions: read-all
17+
18+
jobs:
19+
markdown-lint:
20+
name: Lint markdown files
21+
runs-on: ubuntu-22.04
22+
steps:
23+
- name: Checkout devtools
24+
uses: actions/checkout@v4
25+
26+
- name: Register markdownlint warning matcher
27+
run: |
28+
echo "::add-matcher::.github/markdownlint.json"
29+
30+
- name: Lint markdown files
31+
uses: avto-dev/markdown-lint@v1
32+
with:
33+
args: '**/*.md'
34+
config: '.github/markdownlint.jsonc'
35+
36+
- name: Remove markdownlint warning matcher
37+
if: always()
38+
run: |
39+
echo "::remove-matcher owner=markdownlint::"
40+
41+
- uses: gaurav-nelson/github-action-markdown-link-check@master
42+
if: always()
43+
with:
44+
use-verbose-mode: 'yes'
45+
check-modified-files-only: 'yes'
46+
base-branch: ${{ github.base_ref }}
47+
config-file: '.github/markdown-link-check.jsonc'

0 commit comments

Comments
 (0)