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

Set an explicit GitHub Actions shell #393

Merged
merged 1 commit into from
Sep 26, 2023
Merged

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Sep 25, 2023

Setting an explicit bash shell ensures GitHub Actions enables pipefail mode too, rather than only error on exit (due to GitHub Actions slightly counter-intuitive choice of settings):
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell

This is important for UX since this workflow uses pipes.

For example, without this change, if the docker save command here fails, then the piping to zstd otherwise continues, resulting in an empty exported images archive that will only fail much later in the build when the archive is docker loaded:
https://github.com/heroku/builder/actions/runs/6303703122/job/17113579563?pr=392#step:5:7

This shell is set globally, to avoid needing to specify it for every job or run command:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun

GUS-W-14181209.

Setting an explicit bash shell ensures GitHub Actions enables pipefail
mode too, rather than only error on exit (due to GitHub Actions slightly
counter-intuitive choice of settings):
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell

This is important for UX since this workflow uses pipes.

For example, without this change, if the `docker save` command here
fails, then the piping to zstd otherwise continues, resulting in an
empty exported images archive that will only fail much later in the
build when the archive is `docker load`ed. Such as seen here:
https://github.com/heroku/builder/actions/runs/6303703122/job/17113579563?pr=392#step:5:7

This shell is set globally, to avoid needing to specify it for every
job or run command:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun

GUS-W-14181209.
@edmorley edmorley self-assigned this Sep 25, 2023
@edmorley edmorley marked this pull request as ready for review September 25, 2023 20:05
@edmorley edmorley requested a review from a team as a code owner September 25, 2023 20:05
@edmorley edmorley enabled auto-merge (squash) September 25, 2023 20:10
@edmorley edmorley merged commit ba133b8 into main Sep 26, 2023
35 checks passed
@edmorley edmorley deleted the edmorley/explicit-shell branch September 26, 2023 09:25
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 this pull request may close these issues.

2 participants