-
Notifications
You must be signed in to change notification settings - Fork 286
Validate and update links (STF-557) #311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Links | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| schedule: | ||
| - cron: "0 13 * * 1" # weekly, to catch external link rot without a commit | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| linkChecker: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup mise | ||
| uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 | ||
| with: | ||
| install: false | ||
|
|
||
| # Install only lychee (not the repo's full toolchain) and run the check. | ||
| - name: Check links | ||
| env: | ||
| MISE_AUTO_INSTALL: "false" | ||
| run: | | ||
| mise install lychee | ||
| mise run check-links |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,3 +24,4 @@ vendor/ | |
| # Claude Code directories | ||
| .claude/ | ||
| .claude_cache/ | ||
| .lycheecache | ||
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Lychee link checker configuration | ||
| # https://lychee.cli.rs/#/usage/config | ||
| # | ||
| # Run locally with: | ||
| # lychee './**/*.md' './src/**/*.php' './composer.json' | ||
|
|
||
| # Include URL fragments in checks | ||
| include_fragments = true | ||
|
|
||
| # Don't allow any redirects, so links that have moved are surfaced and updated | ||
| # to their canonical destination. | ||
| max_redirects = 0 | ||
|
|
||
| # Accept these HTTP status codes | ||
| # 100-103: Informational responses | ||
| # 200-299: Success responses | ||
| # 403: Forbidden (some sites use this for rate limiting) | ||
| # 429: Too Many Requests | ||
| # 500-599: Server errors (temporary issues shouldn't fail CI) | ||
| # 999: LinkedIn's custom status code | ||
| accept = ["100..=103", "200..=299", "403", "429", "500..=599", "999"] | ||
|
|
||
| # Exclude URL patterns from checking (treated as regular expressions) | ||
| exclude = [ | ||
| '^file://', | ||
| # Live / auth-gated endpoints that appear as string literals or require login | ||
| '^https://geoip\.maxmind\.com', | ||
| '^https://geolite\.info', | ||
| '^https://minfraud\.maxmind\.com', | ||
| '^https://sandbox\.maxmind\.com', | ||
| '^https://updates\.maxmind\.com', | ||
| '^https://www\.maxmind\.com/en/accounts/', | ||
| 'https://www\.maxmind\.com/en/account/login', | ||
| # Placeholders / local | ||
| '^https?://example\.(com|org|net)', | ||
| '^http://localhost', | ||
| '127\.0\.0\.1', | ||
| ] | ||
|
|
||
| # Exclude file paths from getting checked (treated as regular expressions) | ||
| exclude_path = [ | ||
| '(^|/)node_modules/', | ||
| '(^|/)vendor/', | ||
| # Generated Hugo docs site committed under docs/public | ||
| '(^|/)docs/public/', | ||
| '(^|/)\.git/', | ||
| # Changelog: historical entries are preserved as-is, not rewritten | ||
| '(^|/)CHANGELOG\.md$', | ||
| ] | ||
|
|
||
| # Cache results for 1 day to speed up repeated checks | ||
| cache = true | ||
| max_cache_age = "1d" | ||
|
|
||
| # Skip missing input files instead of erroring | ||
| skip_missing = true | ||
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
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
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accepting all
500..=599(Server Error) status codes will cause lychee to treat permanently broken links or down servers as successful, leading to silent failures. Since lychee has a built-in retry mechanism for transient errors, it is safer to remove"500..=599"from theacceptlist so that persistent server errors are properly surfaced.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping
500..=599inaccept, matching the dev-site and blog-site configs — transient upstream 5xx shouldn't fail link-checking CI.— Claude (posted on Greg's behalf)