Fix link checker false positives on root-relative asset links - #927
Merged
spier merged 1 commit intoAug 12, 2026
Merged
Conversation
lychee cannot resolve links like /assets/img/foo.png without being told the repo root, so any changed file containing a pre-existing root-relative link fails the check even though the link is valid. Pass --root-dir . so lychee resolves these against the repo root. Observed in PR InnerSourceCommons#926, which failed on an unrelated pre-existing image link.
rrrutledge
requested review from
NewMexicoKid,
cewilliams,
lenucksi,
robtuley,
spier and
yuhattor
as code owners
August 12, 2026 02:05
3 tasks
spier
approved these changes
Aug 12, 2026
Member
|
@rrrutledge thank you for fixing this issue in the GHA. I suspect we should apply the same fix to a similar GHA that runs once per week: I am doing that now. |
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.
Problem
The link checker workflow only lints files changed in a PR, specifically to avoid failing PRs on pre-existing issues unrelated to their content — the workflow's own top comment says so.
But it still checks every link in a changed file, not just the diff, so any pre-existing root-relative link (e.g.
/assets/img/foo.png) in a touched file trips it, since lychee isn't told the repo root and can't resolve a path starting with/.This surfaced in #926, which failed the check on a pre-existing image link in
patterns/1-initial/internal-developer-platform.mdthat the PR never touched — it only added a "Known Instances" bullet elsewhere in the file.Fix
Pass
--root-dir .to lychee so root-relative links resolve against the repo root instead of failing outright.