Skip to content

Commit b8de332

Browse files
committed
chore: add workflow which checks links in markdown files
1 parent 7fc648a commit b8de332

File tree

4 files changed

+306
-5
lines changed

4 files changed

+306
-5
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Check Markdown links
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 12 * * *'
7+
pull_request:
8+
paths:
9+
- '**/*.md'
10+
- 'markdown_link_check_config.json'
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
prepare-yarn-cache-ubuntu:
17+
uses: ./.github/workflows/prepare-cache.yml
18+
with:
19+
os: ubuntu-latest
20+
21+
markdown-link-check:
22+
needs: prepare-yarn-cache-ubuntu
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: lts/*
29+
cache: yarn
30+
- name: Run markdown-link-check on MD files
31+
run:
32+
find . -name "*.md" | grep -v node_modules | xargs -n 1 yarn
33+
markdown-link-check -c markdown_link_check_config.json -q

markdown_link_check_config.json

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://docs.github.com"],
5+
"headers": {
6+
"Accept-Encoding": "br, gzip, deflate"
7+
}
8+
}
9+
]
10+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
"jest": "^29.0.0",
132132
"jest-runner-eslint": "^1.1.0",
133133
"lint-staged": "^13.0.3",
134+
"markdown-link-check": "^3.10.2",
134135
"pinst": "^3.0.0",
135136
"prettier": "^2.0.5",
136137
"rimraf": "^3.0.0",

0 commit comments

Comments
 (0)