What exactly does `run:` do in a github action

There is absolutely zero documentation on the use of the run parameter in a step.

Things that used to work, are now throwing command not found errors.

My assumption was that anything passed to run inside of a step is akin to running sh -c, but I get “command not found” when doing something as simple as creating a local variable.

I’ve found many popular github actions whose README’s show using things like:


if [[ ${SOMETHING} == ${SOMETHINGELSE ]]; then

However, if I do that, I get SOMETHING command not found

Can you please document how run is interpreted?

Note: Is run interpreted differently if debug logging is toggled on?

Hi @LongLiveCHIEF,

Glad to see you in Github Community Forum!

run in step will execute command-line programs using the operating system’s shell. You can choose a different shell and customize the shell used to run commands, like: bash, pwsh, powershell,cmd, custom shell…etc. Default shell is different based on the runner os type you choose.

Each run keyword represents a new process and shell in the runner environment. When you provide multi-line commands, each line runs in the same shell.

Please refer to the official doc for more detail usage:

run is NOT interpreted differently if debug logging is toggled on but only for more details.


1 Like