Skip to content

Commit

Permalink
Add markdown link checker action similar to link checker action in Ma…
Browse files Browse the repository at this point in the history
  • Loading branch information
m4ns0ur committed May 15, 2024
1 parent 6f9acc3 commit 36056dd
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/config/link-check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"ignorePatterns": [
{
"pattern": "(localhost|my\\.massa|discord\\.com)"
},
{
"pattern": "^http://manpages.ubuntu.com"
},
{
"pattern": "^https://test.massa.net/api/v2"
},
{
"pattern": "^https://buildnet.massa.net/api/v2"
}
],
"replacementPatterns": [
{
"pattern": "^/",
"replacement": "https://docs.massa.net/"
}
],
"timeout": "20s",
"retryOn429": true,
"retryCount": 5,
"fallbackRetryDelay": "30s",
"aliveStatusCodes": [
200,
206,
0
]
}
25 changes: 25 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check dead links

on:
pull_request:
branches:
- main
schedule:
- cron: '0 10 * * 6'

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install markdown-link-check
run: npm install -g markdown-link-check
- name: Check links in markdown files
run: |
find . \( -name '*.md' -o -name '*.mdx' \) \
-exec markdown-link-check -v -c .github/workflows/config/link-check.json --progress {} \; 2>&1 | tee linkcheck.out
grep -F -wc "[✖] |ERROR" ./linkcheck.out && exit 1 || true

0 comments on commit 36056dd

Please sign in to comment.