Skip to content
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

Unnecessary dependency on bash #13

Closed
ncfavier opened this issue Aug 16, 2022 · 5 comments · Fixed by #14
Closed

Unnecessary dependency on bash #13

ncfavier opened this issue Aug 16, 2022 · 5 comments · Fixed by #14

Comments

@ncfavier
Copy link
Contributor

ncfavier commented Aug 16, 2022

This action sets shell: bash when running simple commands, which causes it to fail in environments where bash isn't available instead of falling back to sh.

I believe the fix is to remove the shell: bash lines replace shell: bash with shell: sh for linux and macos, not sure about windows. See the documentation here

ncfavier added a commit to ncfavier/upload-pages-artifact that referenced this issue Aug 16, 2022
ncfavier added a commit to ncfavier/upload-pages-artifact that referenced this issue Aug 16, 2022
@ncfavier
Copy link
Contributor Author

Note that the documentation is faulty here:

bash The default shell on non-Windows platforms with a fallback to sh. When specifying a bash shell on Windows, the bash shell included with Git for Windows is used.

It does not fall back to sh. Example failed workflow: https://github.com/ncfavier/1lab/runs/7866004286?check_suite_focus=true#step:7:20

@yoannchaudet
Copy link
Contributor

I think you are having issues here because you don't have bash in the container you are building in.

Because bash is available on all platforms and the default for non-Windows, I prefer us to keep using it. I suggest you just install it in your container. I am following up with the Actions team to understand what they mean with "[...] with a fallback to sh".

@ncfavier
Copy link
Contributor Author

ncfavier commented Aug 18, 2022

I know, we're using busybox sh in the container to cut down on image size. sh is the standard name for the POSIX shell and should be available on all (Unix-like) environments, even if it's a symlink to another shell. There is no reason to depend on bash for running a simple tar command with no fancy substitutions.

@yoannchaudet
Copy link
Contributor

Fair enough I take that back. The fallback also does not seem to work if we do specify a bash. Outside of testing, we should be good with your suggested PR.

@rmhrazorhead
Copy link

Does Windows need to specify 'bash'? Yes you can technically install it, but it seems an unnecessary dependency/complication?

ncfavier added a commit to ncfavier/upload-pages-artifact that referenced this issue Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants