From 2cd3e161f596430f06fbcf5bcbcca96b914d5a2d Mon Sep 17 00:00:00 2001 From: Nick Novitski Date: Thu, 19 Oct 2023 10:15:04 -0700 Subject: [PATCH] fix: Fail if build fails! The pipefail option does not catch usage from subshells like this: ``` echo <<<"$(echo foo; exit 1)" ``` Since that's how `nix develop` is called in the script, when the action could not build an environment, it would still be treated as having run successfully, and the job would continue. It's still hypothetically possible for this to happen if `env` or `bash -c 'echo $PATH'` fail. Seems unlikely! But maybe there's something to be done there. --- nix-develop-gha.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nix-develop-gha.sh b/nix-develop-gha.sh index 7f8e6cb..44283bd 100755 --- a/nix-develop-gha.sh +++ b/nix-develop-gha.sh @@ -9,6 +9,8 @@ with_nix_develop() { nix develop --ignore-environment "${arguments[@]}" --command "$@" } +with_nix_develop true # Exit immediately if build fails + contains() { grep "$1" --silent <<<"$2" }