-
Notifications
You must be signed in to change notification settings - Fork 956
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
Default non-Windows bash is not invoked as documented #353
Comments
Just came across this - this is still an issue. |
The behaviour is still the same: https://github.com/johnstevenson/runner-actions-test/runs/1317090059 |
Still appears to be a problem |
This is working as intended, thought I definitely understand with the docs in their current state this is very confusing. For hosted runners, we know bash is installed, so users can expect their steps to run on it. For self hosted runners, we don't have the same luxury. That being said, we should update the docs to clarify this behavior. I've filed an issue to update the documentation so we can improve this experience. Thank you for the report! I'm going to close out this issue for now. If you need this behavior, you can use the job defaults shell and specify it as bash to invoke all steps with |
This is _supposed_ to be the default according to https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_id_stepsshell but actions/runner#353 indicates that this is _still_ not really the case (but the end result is confusing), so we'll be explicit here.
This is _supposed_ to be the default according to https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_id_stepsshell but actions/runner#353 indicates that this is _still_ not really the case (but the end result is confusing), so we'll be explicit here.
I'm aware this issue has been closed for a long time, and this does make sense for self-hosted runners and code running in the self-hosted environment. However, for containers, wouldn't it be preferable to query the default shell before starting the container and set the job defaults appropriately as part of container start? eg.
Let me know if this should be a new issue/suggestion. |
because when apt fails to fetch information (with errors) the whole job should fail actions/runner#353 (comment) actions/runner#353 Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Replace bootargs.cfg file with a stage that generates it Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> * Move nvidia specific files to cloud-init Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> * Move alpine files to cloud-init Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> * Add TODO to fix nvidia partitioning config Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> * Remove not used overlay file for opensuse Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> * Install overlay files as a package Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> * Simplify framework target Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> * Remove `overlay/` directory from yamlling because it doesn't exist anymore Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> * Bump luet repo to get this fix: kairos-io/packages#386 Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> * Don't try to lint non-existent dir Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> * Add pipefail to default shell because when apt fails to fetch information (with errors) the whole job should fail actions/runner#353 (comment) actions/runner#353 Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> --------- Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Describe the bug
The documentation at https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun implies that when a shell is not specified on a non-Windows platform, bash (if found) will be invoked as
bash --noprofile --norc -eo pipefail {0}
.However, this is not exactly the case.
To Reproduce
Steps to reproduce the behavior:
shell: /bin/bash -e {0}
as per this example at https://github.com/johnstevenson/runner-actions-test/actions/runs/48283923 which also shows the documented behaviour when the shell is specified.Expected behavior
For the command to be executed as
shell: /bin/bash --noprofile --norc -e -o pipefail {0}
Runner Version and Platform
Current runner version: 2.165.2
Tested on ubuntu-latest and macos-latest
What's not working?
Regardless of whether this is a documentation problem (or my incorrect interpretation), there is no consistency when invoking bash with and without a shell value.
The
ScriptHandler:RunAsync
code (also duplicated inScriptHandler:PrintActionDetails
) setsshellCommand
assh
even if bash is found, resulting in the wrong format string being used:runner/src/Runner.Worker/Handlers/ScriptHandler.cs
Lines 152 to 168 in d80ab09
So any fix would be:
I'd happily PR this if needed and if I could find out how you debug an action in Visual Studio (are there any docs about this?)
The text was updated successfully, but these errors were encountered: