Skip to content

CICD-023 · Set shell defaults for run steps ​

Encyclopedia · Jobs, steps and runner selection · All snippets

Previous · CICD-022 · Next · CICD-024

1. Where it fits ​

  • Placement .github/workflows/ci.yml, inside the relevant job.
  • Prerequisites workflow containing the named example jobs or steps.
  • Platforms github-actions, gitea-actions.

2. Copy the snippet ​

yaml
defaults:
  run:
    shell: bash
    working-directory: service

3. How it works ​

Defaults apply to run steps in scope. working-directory is interpreted relative to the job workspace, so checkout must create the expected directory before the shell changes into it.

4. Verify the result ​

Provision the directory with checkout first. Action steps retain their own working directory.

Validation syntax-validated (YAML parse). Status definitions.