Interview Prep/GitHub Actions/Workflow Anatomy & Execution Model

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}.

All GitHub Actions questions Roadmap: GitHub Actions

More on Workflow Anatomy & Execution Model