Help
cancel
Showing results for 
Search instead for 
Did you mean: 
ide
Copilot Lvl 2
Message 1 of 1

Declaring a default shell and environment variables across all steps in a job (GitHub Actions)

In a GitHub Actions workflow, is there a way to set defaults that are applied to all steps of a job? Namely, instead of specifying the shell for each step like this:

jobs:
  example:
    steps:
    - run: echo 'hi'
      shell: zsh {0}

 

I'd like to specify the default shell in a job-wide manner, perhaps like this:

jobs:
  example:
shell: zsh {0} steps: - run: echo 'hi'

 

The above syntax doesn't work, but is there another way to achieve job-wide defaults?

 

In addition to specifying the shell, I'd also like to specify job-wide environment variables. Typically I'd do this with BASH_ENV, but it wasn't defined in the CI environment I was using (macOS, specifically).