actionlint icon indicating copy to clipboard operation
actionlint copied to clipboard

Warning if explicit shell is not set

Open jayvdb opened this issue 2 years ago • 2 comments

I've encountered that github actions uses sh as the shell even when bash is on the worker image, unless shell: bash is explicitly added, either for the step or using the defaults https://docs.github.com/en/actions/using-jobs/setting-default-values-for-jobs#example-set-the-default-shell-and-working-directory

IMO it would be useful for actionlint to check whether there is an explicit shell set for any step which uses run, so that the language for the script is known.

jayvdb avatar Nov 01 '23 00:11 jayvdb

Here's evidence of this issue:

- name: Print default shell
   run: |
     ps -p $$
- name: Print bash shell
   shell: bash
   run: |
     ps -p $$

image

michaelvoet avatar Nov 16 '23 22:11 michaelvoet

This is a real issue.

fclante avatar Apr 15 '24 09:04 fclante