Skip to content

TINYDOC-3514 - Add PR-time link checking to preview workflow - #4277

Draft
kemister85 wants to merge 4 commits into
tinymce/8from
hotfix/8/TINYDOC-3514
Draft

TINYDOC-3514 - Add PR-time link checking to preview workflow#4277
kemister85 wants to merge 4 commits into
tinymce/8from
hotfix/8/TINYDOC-3514

Conversation

@kemister85

@kemister85 kemister85 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Ticket: TINYDOC-3514

What this does

Adds the PR-time link check. The preview job already builds the site, so lychee runs over the built HTML (build/docs/tinymce/latest) and sees only real <a href> anchors — URLs inside [source] code samples, and Antora attributes substituted at build time, cannot reach the checker by construction.

The diff is still computed, but only to scope the report to links the PR touched. Because it filters rendered anchors rather than feeding the checker, a malformed match cannot manufacture a failure — only miss one, which the weekly scan (#4276) covers.

Non-blocking at rollout; flip the marked line to exit 1 once the baseline is clean. The report step is continue-on-error, so a checker fault can never fail the preview deployment.

Layer 2 of 2.

Validation

  • Verified end-to-end in CI by a throwaway PR that added two dead links — one in prose, one inside a [source,js] block — alongside live links, an xref:, a self-link, a bot-hostile host and five further code-sample URLs. Result: 1 reported, the prose anchor.
  • This replaces a diff-regex extractor that measured 44 failures out of 279 unique URLs (~16%) across 400 commits of real .adoc history, every one a false positive with no genuine rot among them.
  • .lychee.toml and .lycheeignore are byte-identical to TINYDOC-3514 - Add scheduled link checking to CI #4276.

Follow-up: config needs replicating to tinymce/7, /6 and /5.

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.
@kemister85
kemister85 force-pushed the hotfix/8/TINYDOC-3514 branch from 7d7002f to 811caf6 Compare August 20, 2026 02:18
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