TINYDOC-3514 - Add PR-time link checking to preview workflow#4277
Draft
kemister85 wants to merge 2 commits into
Draft
TINYDOC-3514 - Add PR-time link checking to preview workflow#4277kemister85 wants to merge 2 commits into
kemister85 wants to merge 2 commits into
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 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
Adds the PR-time layer of automated link checking (layer 2 of 2; the scheduled full-site scan is #4276 on
main). This validates only the external links a PR adds or changes in.adocsource, before merge.How it works
A step diffs the PR against its base branch, extracts the URLs from added/changed
.adoclines, and lychee checks only those:url[text]macros correctly (the extractor terminates at[, so the link text is not swallowed into the URL — lychee's raw.adocreader gets this wrong).xref:internal links, self-links totiny.cloud, and bot-hostile hosts (.lycheeignore).fail: false) at rollout — results appear in the job summary. Flip tofail: trueonce the baseline is clean.Files
preview_create.yml—fetch-depth: 0on checkout (needed for the diff) + extract/check steps at the end..lychee.toml,.lycheeignore— same checker config as themainPR.package.json—check-linksscript..gitignore— ignore lychee cache/report.Validation
Verified locally with a synthetic diff covering every link form: a dead added link (
commonjs.org) was flagged; a macro-form MDN link and a bare W3C link passed;xref:, atiny.cloudself-link, and an npm (bot-hostile) link were correctly ignored.Opened as a draft for review. The same PR-time step will be replicated to
tinymce/7,/6,/5once approved here.