Skip to content

fix(link-check): fail on broken links and never open issues - #77

Merged
mroderick merged 2 commits into
mainfrom
fix/link-check
Nov 12, 2026
Merged

mroderick merged 2 commits into
mainfrom
fix/link-check

Conversation

@mroderick

@mroderick mroderick commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

The Link Checker never checked links. 63 scheduled runs produced 63 issues, each with only a link to the run. The checker now fails the job instead of opening an issue.

Why it happened: fail: false kept the workflow green, and the issue step was gated on steps.lychee.outputs.exit_code != 0, which is also true when lychee fails to start. A missing binary exits 127 and the action still writes a report line, so each run created an issue with no content.

What changes:

  • The checker runs lychee directly and fails the job when lychee is missing, the report is absent, or the report's total is zero.
  • No issue is created. A red workflow is the signal.
  • Internal links run on every push and PR; external links run on the schedule.
  • /specs links use /specs/, so the internal check resolves them.
  • The install bounds the download with connect and total timeouts, and locates the binary after extraction instead of hardcoding the tarball layout.

The 63 old issues are deleted. Issue #76 stays.

Evidence and what the checker covers

The 63 runs span 2026-04-27 to 2026-06-27. Each issue body is 117 bytes: the [Full Github Actions output](...) line that lychee-action appends after the report. A working run writes a 430-byte report.

Reproduction: run lychee-action's entrypoint.sh with the same args and lychee absent from PATH. It writes the 117-byte line, sets exit_code=127, and leaves the step green. peter-evans/create-issue-from-file then opens an issue.

Run logs are gone: the last run was more than 90 days ago and gh run view --log returns HTTP 410. The action's changelog has a matching fix: #338 "Install into $RUNNER_TEMP instead of $HOME" (2026-05-12), which addresses a PATH mismatch with the same symptom.

GitHub disabled the workflow after 60 days without a push (the last push was 2026-04-27). That is why the flood stopped on 2026-06-27. GitHub sends scheduled-workflow notifications to the user who created the workflow, so a failing scheduled run is not silent.

The old arguments excluded all internal links: --exclude "^file://" excluded 383 of 518 links. The check only saw external hosts. The new split checks internal links as file links and external links as http(s) links.

Review notes

  • Failure semantics. A scheduled break shows as a red workflow plus GitHub's scheduled-run notification; no issue is opened. The external check runs on the schedule only, so a PR that adds a broken external link shows up on the next scheduled run. Worth a look: whether a red scheduled workflow is the signal you want for a third-party host going down.
  • Deliberately not done: no tracking issue, and no issue creation of any kind. The 63 old issues are deleted.

Note: the workflow is disabled. Re-enable it after merge with gh workflow enable "Link Check".

VitePress renders /specs as /specs.html while the build writes
specs/index.html. The link works in production through a 308 redirect,
but a local check of the built site reports it as a dead file. Point the
nav, sidebar and hero action at /specs/ so the link resolves in both.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7b889ae
Status: ✅  Deploy successful!
Preview URL: https://b74ed9d3.website-33l.pages.dev
Branch Preview URL: https://fix-link-check.website-33l.pages.dev

View logs

The workflow ran the checker with fail: false and gated the issue step on
a non-zero exit code. When lychee could not start, the step exited 127
and the action still wrote a report, so every scheduled run opened an
issue with no content. 63 runs produced 63 issues.

Run lychee directly, fail the job when the tool is missing or the report
is absent or empty, and never open an issue. Internal links run on every
push and PR; external links run on the schedule.

Harden the install and the run: bound the download with connect and total
timeouts, locate the binary after extraction instead of hardcoding the
tarball layout, and run the external check after a failure but not after
cancellation.
@mroderick
mroderick marked this pull request as ready for review November 12, 2026 16:10
@mroderick
mroderick merged commit a8fda74 into main Nov 12, 2026
3 checks passed
@mroderick
mroderick deleted the fix/link-check branch November 12, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant