ci(docs): fix publish jobs cascade-skipped by always() build gate#674
Merged
Conversation
The docs publish jobs (publish-root-files, publish-main-docs, publish-versioned-docs) were silently skipped on every push/tag event since #671, so v1.2.0 published no /1.2/ folder and the root redirect still points at 1.1 — while the run stayed green. Root cause: #671 introduced a PR-only `changes` gate and made `build` depend on it with `always()`. `changes` is skipped on push/tag events; `build` survives via always(), but the publish jobs had plain `if:` conditions with no status-check function, so GitHub injected an implicit success() that evaluates the ancestry — including the skipped `changes` job — and cascade-skipped them despite `build` succeeding. Fix: add `!cancelled()` (a status-check function, which suppresses the implicit success()) plus an explicit `needs.build.result == 'success'` gate to each publish job. Also require `contains(needs.*.result, 'success')` on deploy-to-ic so an all-skipped publish set no longer re-deploys the stale branch to IC mainnet and reports green. This touches only push/tag/dispatch behavior; the PR required-check gating from #671 (changes + build jobs) is unchanged.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes skipped documentation publishing jobs caused by the PR-only build gate.
Changes:
- Adds explicit successful-build gates to all publishing jobs.
- Prevents deployment when no publishing job succeeds.
- Documents the workflow status-check behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lwshang
approved these changes
Jul 24, 2026
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.
Problem
v1.2.0 was released and
versions.jsonwas bumped to1.2, but thedocs-deploymentbranch never received the v1.2 docs:/1.2/folder was created,versions.jsonon the branch still lists1.1aslatest,index.htmlstill redirects to./1.1/,yet every workflow run reported success. The last real deploy to the branch was #669; #670 (release), #671, and #672 published nothing.
Root cause
#671 fixed a required-status-check deadlock by adding a PR-only
changesgate and makingbuilddepend on it withalways():changeshasif: github.event_name == 'pull_request', so on push and tag events it is skipped.buildsurvives that viaalways(). But the three publish jobs had plainif:conditions with no status-check function, so GitHub injected an implicitsuccess()gate. That implicit gate evaluates the job's ancestry, and because a skipped job (changes) sits in the chain, it returnsfalse— cascade-skipping the publish jobs even thoughbuilditself succeeded.deploy-to-icusesalways()and only excludedfailure/cancelled. Sinceskippedis neither, it still ran and re-pushed the unchangeddocs-deploymentbranch to IC mainnet, reporting green — which is what masked the failure.Why this change is required
Without it, no versioned docs will ever publish again on a release, and the root redirect/metadata will never advance past 1.1 — silently, with green runs. Every future release would ship with stale docs. The
always()onbuild(needed for #671's PR gating) is permanent, so the publish jobs must be made resilient to a skipped ancestor.Fix
Add
!cancelled()(a status-check function — its presence suppresses the implicitsuccess()) plus an explicitneeds.build.result == 'success'gate to each publish job.needs.build.resultalone is not sufficient: it's a context expression, not a status function, so the implicitsuccess()would still be injected and still cascade-skip. The!cancelled()is load-bearing.deploy-to-icadditionally requirescontains(needs.*.result, 'success'), so a run where all three publish jobs skipped can no longer redeploy the stale branch and pass as success.Correctness across every trigger
changesbuildmain(docs)v1.2.0/1.2/docs/v1.2branch/1.2/workflow_dispatchon mainbuildfails!cancelled())Scope / relationship to #671
This touches only
push/tag/workflow_dispatchbehavior. The PR required-check gating introduced by #671 is unchanged: thechangesandbuild(docs-build:required) jobs are not modified, sodocs-build:requiredstill reports on every PR and docs-less PRs still pass via a skipped build.Recovery — republishing v1.2 (do this AFTER merge)
Publishing is not retroactive; merging this does not republish v1.2.
1. Publish the missing
/1.2/folder (onlypublish-versioned-docscreates it, on a tag ordocs/v*push).docs.ymlatv1.2.0is byte-identical to this PR's merge base, so the overlay is a clean, docs-only-workflow change and leaves all v1.2 content sources untouched.2. Update the root redirect + metadata (
publish-root-files, main/dispatch only).versions.jsononmainalready marks 1.2 aslatest, so re-run the workflow:Verify: