What shell options does a `run` step use by default on Linux?
IntermediateConceptWorkflow Anatomy & Execution Model
Answer
If you do not set shell, GitHub runs bash -e {0} when bash exists: fail on the first error, but no pipefail. If you explicitly set shell: bash, it runs bash --noprofile --norc -eo pipefail {0}, which also fails on pipeline errors. So npm test | tee out.log can pass with failing tests under the default shell. Many teams set this globally:
defaults:
run:
shell: bash
Other options: sh, pwsh, python, cmd, or a custom template like perl {0}.
More on Workflow Anatomy & Execution Model
Define workflow, run, job, step, action and runner in one line each.BeginnerWhat is the minimum valid workflow file?BeginnerWhere must workflow files live, and does the file extension matter?BeginnerWhich version of the workflow file does GitHub use for a given run?IntermediateWhat does a GitHub-hosted runner give you at the start of a job?BeginnerShould you use `ubuntu-latest` or `ubuntu-24.04`?Beginner