CI: stop masking a failing notebook build#76
Merged
Conversation
The notebook-build step ends with `mkdir -p` and `cp -u`, so the step's exit
code is `cp`'s, not `jb build`'s. `--keep-going` guarantees the .ipynb files
exist for `cp` to succeed on, so a failing strict build reported success.
`shell: bash -l {0}` is a custom shell spec, so GitHub injects no `-eo pipefail`
of its own.
This is the last live instance of the pattern across the five editions:
lecture-intro.zh-cn and lecture-python.zh-cn already carry the fix, and the .fa
and .fr editions are not affected because their builds are the last command in
the step.
The step's twin, "Build HTML", runs the same `-n -W --keep-going` unmasked and
is green, so this bounds what removing the mask can reveal to failures specific
to the jupyter custom builder.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a GitHub Actions CI false-positive in the “Build Download Notebooks (sphinx-tojupyter)” step by ensuring the step fails when jb build fails, rather than accidentally reporting success based on the trailing cp command’s exit status.
Changes:
- Add an explanatory comment describing why
shell: bash -l {0}needs explicit error-handling flags. - Add
set -eo pipefailso the step stops on failures and propagates non-zero exit codes correctly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 notebook-build step reports success when the build fails.
Mechanism
The step runs three commands:
The step's exit code is
cp's, notjb build's.--keep-goingguarantees the.ipynbfiles exist forcpto succeed on even when the build failed, so a failing strict build reports green.shell: bash -l {0}is a custom shell spec, so GitHub injects no-eo pipefailof its own — it only does that for the bareshell: bashshorthand.Scope
This is the last live instance across the five editions.
lecture-intro.zh-cnandlecture-python.zh-cnalready carry the fix; the.faand.freditions are not affected because their builds are the last command in the step. The added comment matches the wording already used inlecture-python.zh-cnso the reason travels with the line.Risk
Bounded. This step's twin,
Build HTML, runs the same-n -W --keep-goingunmasked — it is the last command in its own step — and is green onmain. So removing the mask can only reveal failures specific to the jupyter custom builder, not a long-broken build in general. If CI does go red here, that is a real finding and worth triaging on its own rather than reverting.🤖 Generated with Claude Code