diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml new file mode 100644 index 00000000..f0e02a05 --- /dev/null +++ b/.github/workflows/links.yml @@ -0,0 +1,28 @@ +--- +name: Lychee link checker + +on: + workflow_dispatch: + schedule: + # Run weekly on Sundays at 3 AM UTC to catch broken links + - cron: '0 3 * * 0' + +permissions: + contents: read + +jobs: + link-checker: + name: Lychee link checker + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@v2.8.0 + with: + # Check all Markdown files in the repository + args: --config lychee.toml --verbose --no-progress --max-redirects 10 '**/*.md' + fail: true diff --git a/.gitignore b/.gitignore index cc010235..64122eb5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ coverage node_modules .directory +.github/copilot-instructions.md .idea dist/ /venv/ diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 00000000..eefa7b3d --- /dev/null +++ b/lychee.toml @@ -0,0 +1,39 @@ +# Lychee link checker configuration +# This file configures how lychee validates links in the repository +# +# For more information about lychee configuration, see: +# https://github.com/lycheeverse/lychee#configuration +# +# This configuration addresses false positive errors from the link checker: +# - 403 Forbidden: Some sites (shields.io, qlty.sh) block automated requests +# but work fine in browsers +# - 429 Too Many Requests: Rate limiting doesn't mean the link is broken + +# Accept these HTTP status codes as valid +# 200: OK (standard success) +# 204: No Content (valid response with no body) +# 206: Partial Content (valid for range requests) +# 403: Forbidden (some sites block automated requests but links work in browsers) +# 429: Too Many Requests (rate limiting, link may be valid) +accept = [200, 204, 206, 403, 429] + +# Timeout for requests (in seconds) +timeout = 30 + +# Maximum number of retries per link +max_retries = 3 + +# Maximum number of concurrent network requests +max_concurrency = 8 + +# User agent string to use for requests +# Some sites require a browser-like user agent to avoid blocking +user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0" + +# Exclude URL patterns from link checking +exclude = [ + '^http://127\.0\.0\.', + '^http://localhost', + '^https://localhost', + '^file://', +] \ No newline at end of file