Check for Dead Links #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check for Dead Links | |
| on: | |
| schedule: | |
| # Run every Sunday at 2 AM UTC | |
| - cron: '0 2 * * 0' | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - '**.md' | |
| - 'mkdocs.yml' | |
| jobs: | |
| link-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Link Checker | |
| uses: lycheeverse/lychee-action@v2 | |
| with: | |
| # Check all markdown files | |
| args: > | |
| --verbose | |
| --no-progress | |
| --accept=200,201,202,203,204,301,302,303,307,308 | |
| --timeout 20 | |
| --max-retries 3 | |
| --user-agent "Mozilla/5.0 (compatible; pms-wiki-link-checker)" | |
| --exclude-private | |
| --exclude "^(?i:mailto)" | |
| --exclude "^(?i:javascript)" | |
| --exclude "github.com/.*/edit/" | |
| --exclude "github.com/.*/blob/" | |
| --exclude "localhost" | |
| --exclude "127.0.0.1" | |
| --exclude "example.com" | |
| --exclude "example.org" | |
| --exclude "plausible.ktz.cloud" | |
| --exclude "techhub.social" | |
| --exclude-path node_modules/ | |
| --exclude-path .git/ | |
| '**/*.md' | |
| fail: true | |
| format: markdown | |
| output: ./lychee-report.md | |
| jobSummary: true | |
| - name: Upload link check report | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: link-check-report | |
| path: lychee-report.md | |
| - name: Create issue from failed link check | |
| if: failure() && github.event_name == 'schedule' | |
| uses: peter-evans/create-issue-from-file@v5 | |
| with: | |
| title: "Broken links detected in documentation" | |
| content-filepath: ./lychee-report.md | |
| labels: | | |
| documentation | |
| broken-links | |
| automated |