TINYDOC-3514 - Add external link checking to pull requests /latest - #4277
Merged
Merged
Conversation
Validate the external links a PR adds or changes in .adoc source before merge. A step extracts URLs from the PR diff (handling AsciiDoc url[text] macros, ignoring xref internals and self-links) and lychee checks only those, so the changed link is verified once regardless of how many pages include it. - preview_create.yml: fetch full history for the diff; add extract + check steps after the preview upload (non-blocking, fail: false) - .lychee.toml / .lycheeignore: checker config and curated ignore list - package.json: check-links script for local use - .gitignore: ignore the local lychee cache and report output
grep -c on an empty changed-links.txt printed 0 and exited 1, so the fallback also fired and wrote a stray line to GITHUB_OUTPUT (Invalid format). Use wc -l, which returns a single value and exits cleanly.
This was referenced Aug 20, 2026
kemister85
force-pushed
the
hotfix/8/TINYDOC-3514
branch
from
August 20, 2026 02:18
7d7002f to
811caf6
Compare
Narrows the PR-time check from a full ~410-URL crawl of the built site to the links the pull request actually changed. lychee --dump lists rendered anchors without making any requests, so the built-HTML guarantee is unchanged; only the intersection with the diff is checked over the network. Also restores the on-disk request cache, which the config asks for but which had no effect on a clean runner, and tightens the timeout and retry budget for the PR-time run via CLI flags so .lychee.toml stays identical to the scheduled scan.
lychee-action@v2 is a floating major tag, so its default checker version can move without a change here. Pin it explicitly in both steps to keep results reproducible.
A broken link now fails its own required-able status check instead of printing a warning on a green preview run. The check moves out of the preview deployment workflow into a separate one, so a link problem is never reported as a failed deployment and infrastructure flakiness in the deploy path cannot block merges. preview_create.yml is left byte-identical to the base branch. The check builds only the current branch, since the published versions are the deploy pipeline's concern. It fails closed when the checker produces no report, and only considers links the pull request touched: blocking on pre-existing rot would make the gate unmergeable.
The label is applied when a run finds broken links and removed as soon as a later run comes back clean, so it clears itself when the author pushes a fix. Reporting, labelling and failing are now separate steps: a single step that exited non-zero would skip its own labelling, leaving the label stale on exactly the runs that matter. Nothing is changed when the checker could not verify the links, since the absence of a result is not evidence that the links are healthy. Labelling is best-effort so that a fork's read-only token cannot turn a missing label into a failed check that hides the real result.
kemister85
requested review from
a team,
ShiridiGandham,
TheSpyder,
kimwoodfield,
metricjs and
shanmen-tiny
and removed request for
a team
August 31, 2026 00:14
Only the playbooks that set latest_version_segment produce build/site/tinymce/latest; tinymce/6 and tinymce/5 produce build/site/tinymce/6 and build/site/tinymce/5. A glob that matches nothing is only a lychee [WARN], so the check would have passed silently on those branches while verifying nothing.
This was referenced Aug 31, 2026
kemister85
marked this pull request as ready for review
August 31, 2026 00:31
/latest
tiny-ben-tran
approved these changes
Aug 31, 2026
ShiridiGandham
approved these changes
Aug 31, 2026
This was referenced Sep 1, 2026
Merged
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.
Ticket: TINYDOC-3514
Site: Staging (CI-only change; no page content differs)
Adds a
Link Checkworkflow that checks external links a pull request has added or changed. A broken link fails the check and applies thelink-rotlabel; pushing a fix clears both on the next run. It does not block merging — the check is not required.Links are read from the built HTML rather than the
.adocdiff, so URLs in[source]blocks and build-time attributes cannot reach the checker. The diff only narrows which rendered anchors get checked. It is a separate workflow so a link problem is never reported as a failed deployment;preview_create.ymlis untouched.Changes:
.github/workflows/link-check-pr.yml..lychee.tomland.lycheeignore(redirects and rate limiting treated as healthy; bot-hostile hosts curated per URL rather than blanket-accepting 403).check-linksscript topackage.jsonand cache/report output paths to.gitignore.Note: verified in CI on throwaway pull requests — broken link fails and labels, fix clears both, no changed links skips the build. A dead URL inside a
[source,js]block was among the diff candidates and correctly excluded on both runs. Follow-up: replicate tomain,tinymce/7,/6and/5once exercised in production.Pre-checks:
hotfix/8/TINYDOC-3514Review: