actionlint icon indicating copy to clipboard operation
actionlint copied to clipboard

Any program on `$PATH` can be a `shell`

Open 9999years opened this issue 9 months ago • 1 comments

actionlint only accepts bash, pwsh, python, and sh as valid shell names, but GitHub lets you use any executable on $PATH as a shell.

.github/workflows/example.yml:58:16: shell name "nix develop" is invalid. available names are "bash", "pwsh", "python", "sh" [shell-name]
   |
58 |         shell: nix develop
   |                ^~~

Perhaps there should be an additional configurable allowlist for shell names, like the self-hosted-runner.labels key.

See: "TIL: Any program can be a GitHub Actions shell" by William Woodruff

9999years avatar Apr 10 '25 22:04 9999years

The contract is a bit narrower than the blog post implies; the shell has to contain {0}.

Error: Invalid shell option. Shell must be a valid built-in (bash, sh, cmd, powershell, pwsh) or a format string containing '{0}'

9999years avatar Apr 10 '25 22:04 9999years