-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable shellcheck when shell is powershell or pwsh #315
Comments
Hmm, seemingly, it doesn't run shellcheck when I explicitly set defaults:
run:
shell: pwsh |
Please branch your workflow step. - run: actionlint
if: ${{ runner.os != 'Windows' }}
- run: actionlint -shellcheck=
if: ${{ runner.os == 'Windows' }} It doesn't make sense to disable shellcheck on Windows by default because shellcheck supports Windows. |
Sorry, I was out of town until this morning. I think I understand. The problem was because actionlint was running shellcheck on a Windows-based runner, and the Windows runners do not support bash or sh as shell options, so that's never valid. While you can run shellcheck on Windows against bash scripts, that doesn't really apply in the context of GitHub Actions. I can use the workaround you suggest though, if you don't see a way of handling that internal to actionlint. |
Though the default shell is |
🤯 oooooh! I had no idea Ok, how about this bit then. It seems like actionlint skips shellcheck when
See this commit for how I worked around the original error in the first place. But perhaps actionlint could detect an explicitly set default shell that is not sh/bash, and skip shellcheck? Would that be something that you think actionlint ought to handle? Of course you've offered some other workarounds, so I understand if you think it's good enough as is. Really appreciate all your help! |
I'm trying to figure out how to disable the shellcheck integration only when the shell is powershell or pwsh. I know about
-shellcheck=
, but for projects that exercise both linux and windows runners, we want shellcheck to run on the linux runners. Is there any way to exempt some workflow files from shellcheck entirely?Here's a run with an example of the failure we're seeing: https://github.com/plus3it/actions-workflows/actions/runs/5380111038/jobs/9762319339?pr=18
The text was updated successfully, but these errors were encountered: