Repository navigation
Stop running the documentation workflow twice per push - #508
Merged
Merged
Conversation
The Documentation badge reads failing after almost every merge to master, and the docs are fine. Two runs start on every push and compete for the same concurrency group: CI push success 2026-11-09T22:00:27Z Documentation push cancelled 2026-11-09T22:00:27Z Documentation push cancelled 2026-11-09T21:59:51Z CI push success 2026-11-09T21:59:51Z Same timestamps. ci.yml had a `docs` job calling documentation.yml via workflow_call, and documentation.yml also triggers on push to master. Both hold `concurrency: group: "pages"`, so one is cancelled -- and GitHub renders a cancelled run as a failing badge, on the workflow the README badge points at. It is worse than a cosmetic problem. Under workflow_call from a push, github.event_name is still 'push', so the deploy job's `if` was true in the called run as well: both runs were deploying the same commit to Pages, and only the concurrency group kept them from doing it at once. So ci.yml no longer calls it, and documentation.yml takes `pull_request` instead -- which is what the ci.yml job was really providing, a docs build on pull requests. Deployment is still gated on a push to master, so a pull request builds the docs without publishing them. One run per event now. The concurrency group moves from the workflow to the deploy job. At workflow level it could cancel a queued *build*, which is how an ordinary pair of merges 36 seconds apart produced a failing badge over documentation that had built perfectly well. Deployments still serialise, which is what Pages needs, and an in-progress deployment is still allowed to finish. Checked before changing the job names: master has no branch protection and no required status checks, so dropping `docs / Build documentation with Sphinx` from the CI run breaks no gate. The same check now arrives from the Documentation workflow. Residual case, much narrower: three or more pushes to master inside a single deploy still leaves a superseded deployment cancelled. Skipping the docs deployment for a commit that is already two commits stale is the right outcome; it just means the badge can still go red in that case.
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.
The Documentation badge reads failing after almost every merge to master, and the docs are fine.
Two runs start on every push and fight over the same concurrency group:
Identical timestamps.
ci.ymlhad adocs:job callingdocumentation.ymlviaworkflow_call, anddocumentation.ymltriggers on push to master itself. Both holdconcurrency: group: "pages", so one gets cancelled — and GitHub renders a cancelled run as a failing badge, on exactly the workflow the README badge points at.It wasn't only cosmetic
Under
workflow_callfrom a push,github.event_nameis still'push'— so the deploy job'sifwas true in the called run as well. Both runs were deploying the same commit to GitHub Pages, and only the concurrency group stopped them doing it simultaneously.The change
ci.ymlno longer calls it. That job's real value was building docs on pull requests, sodocumentation.ymlnow takespull_requestdirectly. Deployment stays gated on a push to master, so a PR builds the docs without publishing them. One run per event.deployjob. At workflow level it could cancel a queued build, which is how two merges 36 seconds apart produced a red badge over documentation that had built perfectly. Deployments still serialise — which is what Pages requires — and an in-progress deployment still finishes.Before changing job names
masterhas no branch protection and no required status checks, so droppingdocs / Build documentation with Sphinxfrom the CI run breaks no gate. The same check now arrives from the Documentation workflow instead.Residual case
Three or more pushes to master inside a single deploy still leaves a superseded deployment cancelled. That outcome is correct — skipping a docs deploy for a commit that's already two commits stale is what you want — it just means the badge can still go red in that narrow case. Worth knowing rather than discovering again.
This PR exercises the change:
documentation.ymlshould appear once on it, building but not deploying.