Gate pull requests on links in the files they change - #181
Merged
Merged
Conversation
The link check ran over every content file with fail: false, so broken links in a pull request were reported in the job summary but the check still reported success. Dead links in archived event pages are the reason the run could not be made blocking as a whole. Split the workflow into two jobs. Pull requests check only the content files they add or edit and fail when a link in those files is broken. The weekly sweep and manual runs keep the repo-wide advisory report. The pull request file list comes from the GitHub API rather than a git diff against the base ref, which needs no merge base and so avoids the full-history fetch a shallow checkout would otherwise require. Shared lychee flags move to a workflow-level LYCHEE_ARGS env var so the two jobs stay in step, and the token is narrowed to the reads the jobs actually perform. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for nwborg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Confirms the pull request link check fails on a broken link. Reverted once the run is observed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This reverts commit 8b86166.
rly
marked this pull request as ready for review
September 16, 2026 04:55
oruebel
approved these changes
Sep 20, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The link check ran over every content file with
fail: false, so broken links in a pull request landed in the job summary while the check itself reported success. PR #180 is the example: lychee correctly flagged all three 404s in the new news post, and the check was still green.The reason
fail: falsewas there is real. Archived event pages carry roughly 35 dead links, so a repo-wide blocking check would fail every PR.What changed
Two jobs, split by event:
pr_link_checkpull_requestcontent/**files the PR adds or editsfull_link_checkschedule,workflow_dispatchcontent/**New links get a real gate. The pre-existing dead links stay advisory on the weekly sweep, where they can be triaged separately.
The PR file list comes from the GitHub API (
pulls/{n}/files) rather than agit diffagainst the base ref. The API needs no merge base, so a shallow checkout is enough, and it is exact about renames and deletions.Shared lychee flags moved to a workflow-level
LYCHEE_ARGSenv var so the two jobs cannot drift apart. The workflow also now declares a read-onlypermissions:block covering just the reads these jobs perform.Two incidental fixes: the trigger comment said "dev branch" while the trigger is
main, and theid: lycheeon a step nothing referenced is gone.Verification
A test commit on this branch adds a content file with a deliberately broken link, to confirm the PR job actually goes red. That commit is reverted once the run is observed.
🤖 Generated with Claude Code