ci: run every workflow step under bash -euo pipefail - #33
Merged
Merged
Conversation
The runner's default shell is "bash -e {0}", so an unset variable expanded
to an empty string and a command that failed mid-pipeline went unnoticed.
Set the shell once per workflow via defaults.run instead, and drop the
per-step "set -euo pipefail" lines it supersedes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146WGNYA5chgKdzwn1ZGLw3
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.
Summary
Every workflow now sets its shell once:
The runner's default for
runsteps isbash -e {0}, so-ewas already in effect everywhere; what this adds is-u(an unset variable is an error instead of an empty string) and-o pipefail(a command failing anywhere in a pipeline fails the step, not just the last one).The five per-step
set -euo pipefaillines are now covered by the workflow-level shell and are removed:ci.yml:List features under src/,Assemble the test workspacerelease.yml:Create PR for Documentationupdate-material.yml:Refresh trusted material,Create PR for refreshed materialThe steps that had no
setline gain the options: the CLI install,devcontainer up, and thesmoke_test.shinvocation. Each reads only variables defined in its ownenv.Impact review
Each
runblock was checked for an unset variable reference and for a pipeline whose non-final command is allowed to fail; none exists here. The scripts that do not need a Dev Container were executed underbash -euo pipefail: feature discovery andAssemble the test workspace.scripts/update-material.shis run asbash scripts/update-material.sh, a fresh shell, so its own options are unchanged by this.🤖 Generated with Claude Code
https://claude.ai/code/session_0146WGNYA5chgKdzwn1ZGLw3
Generated by Claude Code