fix(maintenance): the sweep ran under bash -e and could not report a finding - #176
Merged
Conversation
…a finding
The first real run of maintenance.yml failed, and only the run could show why.
GitHub runs `run:` steps as `bash -e {0}`. `-e` arrives on the shell's own
command line, where no `set` inside the script can reach it -- so the step's
`set -uo pipefail`, and its comment stating that `-e` was deliberately absent,
were both wrong. On the first finding bash aborted at the sweep line: `$?` was
never read, sweep.txt was never printed, and $GITHUB_OUTPUT never received a
status. The report step then had nothing to act on.
The mechanism was unreachable in exactly the case it exists for.
`shell: bash {0}` fixes it. The report step becomes `if: always()` so a sweep
that dies for another reason is still reported, and an empty status is treated
as a finding rather than as silence.
The contract now resolves the shell the way GitHub does -- step, job defaults,
workflow defaults, then `bash -e {0}` -- and executes the sweep step under it
with a stub interpreter, asserting the exit code is recorded for a clean sweep
and for a finding. Reverting to the default is caught, and so is declaring
plain `bash`, which expands to `--noprofile --norc -eo pipefail`.
This was referenced Aug 14, 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.
Found by running it
PR #172 made
maintenance.ymlable to fetch tags and file an issue. I then dispatchedit — the first execution in its life. It failed, and the log shows why:
Note what is missing: no
cat sweep.txt, nostatus=. The step died at the sweepline itself.
The defect
GitHub runs
run:steps asbash -e {0}.-earrives on the shell's own commandline, where no
setinside the script can reach it. The step said:That comment was false.
set -uo pipefaildoes not remove an-ethat the shell wasinvoked with. So on the first finding — the only time this job matters — bash aborted
before
status=$?,$GITHUB_OUTPUTnever received a status, and the report step hadnothing to act on. No
if:on that step either, so a failed sweep skipped reportingaltogether.
Three layers of the same shape: the reporting mechanism was unreachable in exactly
the case it exists for.
Fix
shell: bash {0}on the sweep step — the documented way to get a bash without-e.if: always()on the report step.findings vanish looks identical to one with nothing to say.
Proof
The contract now resolves the effective shell the way GitHub does — step, then job
defaults.run.shell, then workflow defaults, thenbash -e {0}— and executes thesweep step under it with a stub interpreter, asserting the exit code reaches
$GITHUB_OUTPUTfor both a clean sweep and a finding.bash -e)bash(expands to-eo pipefail)The second case matters:
shell: bashlooks like a fix and is not — it expands tobash --noprofile --norc -eo pipefail {0}.Still unknown
What the sweep actually found on the runner is still unknown, because the step died
before printing
sweep.txt. Locally all three tiers are green. I will re-runmaintenance.ymlafter this merges and report what it says.Verification
validate_all— all three tiers OK withGH_TOKENactionlint— clean ·zizmor@1.26.1 --persona pedantic --min-severity low— no findings