This commit is contained in:
Markus Frosch 2026-05-23 13:30:12 +08:00 committed by GitHub
commit 99d974f59b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 38 additions and 0 deletions

13
.github/workflows/markdown-links.yml vendored Normal file
View file

@ -0,0 +1,13 @@
name: Check Markdown links
on: push
jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: tools/markdown-link-check.json
use-quiet-mode: yes

View file

@ -0,0 +1,5 @@
{
"ignorePatterns": [
{"pattern": "^https://github.com/icinga/icinga2/issues/"}
]
}

20
tools/markdown-link-check.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/bash
set -e
PATH="$(pwd)/node_modules/.bin:${PATH}"
errors=0
while read -r file; do
if ! markdown-link-check --config tools/markdown-link-check.json --quiet "$file"; then
(( errors++ )) || true
fi
done < <(find -name \*.md)
if [[ $errors -gt 0 ]]; then
echo
echo "Found ${errors} files with errors!"
echo
exit 1
fi