Repository navigation
ci: docs link check for learning/ (OPS-71) - #37
Merged
Merged
Conversation
…sync and before push (OPS-71) scripts/check-docs-links.mjs (dependency-free node, about 0.05 s) checks every link in learning/ the way the docs sync publishes it to thebridge.dev/docs: relative .md links must point at an existing file and heading, and must be a form the sync rewrites to that file's own page; site paths like /auth/config/ must be real docs pages (scripts/docs-site-pages.txt, plus the pages this repo's own learning/ produces); #anchors must match a heading; two files must not publish to the same page. It runs in three places: - the Docs links workflow, on pull requests to main that touch learning/ or the checker (separate from build, test and publish); - the Sync Docs workflow, before the sync, so a broken link never reaches the website; - before push, via .githooks/pre-push, when a pushed commit touches learning/. Opt in per checkout with: git config workflows.localPrePush .githooks/pre-push Refs: OPS-71
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.
Adds the docs link check that the other SDK repos get in OPS-71, so a broken link in
learning/is caught before it reaches the website.learning/on main has no broken links today, so there are no link fixes here.Docs link check (approved by the owner)
scripts/check-docs-links.mjs: dependency-free node, about 0.05 s. It checks every link inlearning/the way the docs sync publishes it to thebridge.dev/docs:.mdlinks: the file exists, any#anchormatches a heading, and the link is a form the sync rewrites to that file's own page (the sync cannot rewrite a link naming two or more folders);/auth/config/,/docs/...): a real docs page, fromscripts/docs-site-pages.txt(regenerate with--print-site-pages <bridge-web>/bridge-docs/src/content/docs) plus the pages this repo's ownlearning/produces;#anchorson the same page, and two files publishing to the same page.README.md files are skipped (the sync does not publish them).
Where it runs:
.github/workflows/docs-links.yml: pull requests to main touchinglearning/or the checker. A separate workflow; build, test and publish jobs are unchanged.sync-docs-only.yml: a step before the sync, so a broken link stops the sync instead of reaching the website..githooks/pre-push, through the shared hook's opt-in (git config workflows.localPrePush .githooks/pre-push; undo withgit config --unset workflows.localPrePush). Runs only when a pushed commit toucheslearning/or the checker, and checks the pushed commit, not the working tree. Skip once:SKIP_LINK_CHECK=1 git push.node scripts/check-docs-links.mjs(orcheck:docs-linksin package.json).Merging to main does not change docs, so it does not trigger a docs sync. Not merged by the author.
Refs: OPS-71