Fix release workflow swallowing its own error output under set -e #6

Merged
jsanchezd merged 1 commit from fix/release-set-e-guard into main 2026-09-29 12:24:19 +00:00
Owner

Confirmed via the runner's own debug-level log (temporarily bumped, reverted after): the "Consolidate changelog fragments" step really did fail (exitcode 1) but printed nothing, not even from the cat calls meant to surface it.

Root cause: bash -e (which this runner uses for every run: script) aborts immediately on a failing command -- including a redirected antsibull-changelog ... > file 2>&1 -- before reaching the following rc=$?/cat lines. The previous fix (a8b68a6) redirected output correctly but never checked the exit status in a way that survives set -e, so the real error was silently swallowed on both runs #19 and #20.

Fixed with if ! ...; then ... fi, a conditional context that doesn't trigger set -e. Verified locally against the exact bash --noprofile --norc -e -o pipefail invocation this runner uses.

🤖 Generated with Claude Code

https://claude.ai/code/session_012icUrjv3vgHtovVpHUFjdp

Confirmed via the runner's own debug-level log (temporarily bumped, reverted after): the "Consolidate changelog fragments" step really did fail (exitcode 1) but printed nothing, not even from the `cat` calls meant to surface it. Root cause: `bash -e` (which this runner uses for every `run:` script) aborts immediately on a failing command -- including a redirected `antsibull-changelog ... > file 2>&1` -- before reaching the following `rc=$?`/`cat` lines. The previous fix (a8b68a6) redirected output correctly but never checked the exit status in a way that survives `set -e`, so the real error was silently swallowed on both runs #19 and #20. Fixed with `if ! ...; then ... fi`, a conditional context that doesn't trigger `set -e`. Verified locally against the exact `bash --noprofile --norc -e -o pipefail` invocation this runner uses. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012icUrjv3vgHtovVpHUFjdp
Fix release workflow swallowing its own error output under set -e
All checks were successful
Ansible Lint / ansible-lint (pull_request) Successful in 35s
aa07c70e5f
Confirmed via the runner's own debug-level log (bumped log.level to
debug on the runner LXC temporarily, re-dispatched, reverted after):
the "Consolidate changelog fragments" step really did fail (exitcode
1) but printed absolutely nothing, not even from the `cat` calls meant
to surface it.

Root cause: `bash -e` (which this runner invokes every `run:` script
with) aborts immediately on a failing command's non-zero exit --
including "antsibull-changelog release ... > file 2>&1" -- before ever
reaching the following `rc=$?`/`cat` lines. The previous commit
(a8b68a6) redirected output to a file correctly, but never checked the
exit status in a way that survives set -e, so the actual error was
silently swallowed both times it ran (runs #19 and #20).

Fixed by wrapping each antsibull-changelog call in `if ! ...; then`,
which IS a conditional context and so does not trigger set -e.
Verified locally: a script using this exact pattern with a
deliberately failing command, run via the identical
`bash --noprofile --norc -e -o pipefail` invocation this runner uses,
correctly prints the captured output instead of aborting silently.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012icUrjv3vgHtovVpHUFjdp
jsanchezd deleted branch fix/release-set-e-guard 2026-09-29 12:24:19 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ansible-collections/silvarion.repos!6
No description provided.