Skip to content

Make dead-link check tolerant of transient failures#987

Open
ecomodeller wants to merge 1 commit into
mainfrom
ci/lychee-dead-links
Open

Make dead-link check tolerant of transient failures#987
ecomodeller wants to merge 1 commit into
mainfrom
ci/lychee-dead-links

Conversation

@ecomodeller

Copy link
Copy Markdown
Member

The scheduled broken-links check fails intermittently on slow or bot-hostile external servers — e.g. run 27932206514 failed only because a citation host (archimer.ifremer.fr) timed out after retries. That is alert noise, not a broken link.

The previous action, ScholliYT/Broken-Links-Crawler-Action, treats a timeout identically to a 404 and exposes no option to accept transient errors. So the workflow cannot express "only fail on links that are permanently gone".

This switches to lycheeverse/lychee-action, which can: --accept-timeouts makes timeouts non-fatal, and --accept 200..=299,403,429 tolerates rate-limiting/bot-blocking, while genuine 404/410 still fail the run.

Because lychee does not recursively crawl a live site, the workflow now builds the docs (just docs, same recipe as the docs deploy) and checks the rendered HTML under docs/_site/. The two URL exclusions from the old config move to .lycheeignore (GitHub "edit" links and the crawler-hostile MIKE Powered by DHI doc/help portals).

Verified locally against a fresh build: 3713 links OK, 0 errors (exit 0); an injected dead dhi.github.io URL still fails (exit 2).

The scheduled link check failed intermittently on slow/bot-hostile
external servers (e.g. a timing-out citation host), treating a timeout
the same as a 404. ScholliYT/Broken-Links-Crawler-Action has no way to
distinguish transient errors from permanently-gone links.

Switch to lycheeverse/lychee-action with --accept-timeouts and
--accept 200..=299,403,429 so timeouts and rate-limiting no longer fail
the run, while genuine 404/410 still do. lychee can't recursively crawl
a live site, so build the docs and check the rendered HTML instead.
Carry the previous URL exclusions over to .lycheeignore.
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