Skip to content

ci: gate the artifact that actually ships, not only the ones in pull requests - #129

Merged
fas89 merged 1 commit into
mainfrom
ci/gate-the-deploy
Sep 15, 2026
Merged

fas89 merged 1 commit into
mainfrom
ci/gate-the-deploy

Conversation

@fas89

@fas89 fas89 commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

scripts/check-dist-links.mjs was wired into docs-pr-check.yml alone — and that workflow is pull_request-only. So the job that uploads to GitHub Pages ran:

npm ci → npm run docs:build → touch .nojekyll → upload-pages-artifact

…with nothing between the build and the upload.

Two ways a broken site shipped past a green history

  • a direct push to main was ungated entirely — docs-pr-check.yml never fires
  • two PRs, each green against its own base, can combine into a broken artifact that neither run examined

Where the step goes, and why there

Between Build docs and .nojekyll — before the upload, so a bad artifact is never published rather than published and then reported.

No continue-on-error, no || true, and deliberately not if: always(). A failed build leaves no artifact, and measuring an absent or stale dist is the exact failure this exists to prevent. The script refuses to run when dist is missing, so a green result here always means it read the bytes this job is about to upload.

Verified on this branch

npm run docs:build                  exit 0
node scripts/check-dist-links.mjs   exit 0
  HTML pages walked     219   (floor 180)
  absolute, same-origin 107,738   (floor 90,000)
  distinct targets      474   (floor 400)
  resolved by rule      exact 100,779, dir index.html 6,864, extensionless +.html 95

And proved load-bearing here the same way it was in the PR workflow — link: '/why' → '/whyy' in the config.ts navbar:

npm run docs:build                  exit 0    <- the hole
node scripts/check-dist-links.mjs   exit 1    <- 424 dead references across 212 pages

Restored, rebuilt, both green again. Only deploy-docs.yml is modified; YAML re-parsed to confirm the step sits at index 4 between build (3) and .nojekyll (5), with keys name,run only.

This does not make docs-pr-check.yml redundant

The coverage map in that file says why. It reports a repository path a contributor can act on (this one reports dist paths), and it runs on a source-only change. This step is the last thing between a build and the live site.

…requests

`scripts/check-dist-links.mjs` was wired into docs-pr-check.yml alone, and that
workflow is `pull_request`-only. So the job that uploads to GitHub Pages ran
`npm ci`, `npm run docs:build`, `touch .nojekyll`, `upload-pages-artifact`, with
nothing between the build and the upload.

Two ways a broken site shipped past a green history:

- a direct push to main was ungated entirely;
- two pull requests, each green against its own base, can combine into a broken
  artifact that neither run examined.

The step goes BEFORE `.nojekyll` and the upload, so a bad artifact is never
published rather than published and then reported.

No `continue-on-error`, no `|| true`, and deliberately not `if: always()`. A
failed build leaves no artifact, and measuring an absent or stale dist is the
exact failure this exists to prevent; the script refuses to run when dist is
missing, so a green result here always means it read the bytes this job is about
to upload.

Verified on this branch, not assumed:

  npm run docs:build                exit 0
  node scripts/check-dist-links.mjs exit 0 - 219 pages, 107,738 absolute
                                    references, 474 distinct targets, canaries
                                    passing

...and the gate proved load-bearing here the same way it was in the pull-request
workflow. With `link: '/why'` changed to `'/whyy'` in the config.ts navbar:

  npm run docs:build                exit 0    <- the hole
  node scripts/check-dist-links.mjs exit 1    <- 424 dead references, 212 pages

Restored, rebuilt, both green again.

This does not make docs-pr-check.yml redundant; the coverage map in that file says
why. It reports a REPOSITORY path a contributor can act on, and it runs on a
source-only change. This one is the last thing between a build and the live site.
@fas89
fas89 merged commit a5c4ee8 into main Sep 15, 2026
5 checks passed
@fas89
fas89 deleted the ci/gate-the-deploy branch September 15, 2026 18:29

This branch was successfully deployed

1 active deployment
github-pages — 9ddd48e3 Deployed Sep 15, 2026 by fas89 via deploy #164
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