Skip to content

Commit

Permalink
fix: Fail if build fails!
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nicknovitski committed Oct 19, 2023
1 parent f335595 commit 2cd3e16
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nix-develop-gha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 2cd3e16

Please sign in to comment.