Interview Prep/CI/CD/GitHub Actions

What do `defaults.run` and `shell` do?

BeginnerConceptGitHub Actions
Answer

defaults.run.shell and defaults.run.working-directory set defaults for all run steps in a workflow or job, so you do not repeat them. On Linux the default shell is bash -e {0} unless you set shell: bash, which uses bash --noprofile --norc -eo pipefail {0}, so pipes fail properly. Always set shell: bash when you rely on pipefail.

defaults:
  run:
    shell: bash
    working-directory: ./app
All CI/CD questions

More on GitHub Actions