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
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?Intermediate