diff options
| author | Alois Klink <alois@aloisklink.com> | 2022-11-23 18:37:01 +0000 |
|---|---|---|
| committer | Josef Schlehofer <pepe.schlehofer@gmail.com> | 2023-09-01 21:55:16 +0200 |
| commit | 8e68501e2e8fa7d077b50d6a8d0234f989f486af (patch) | |
| tree | 8ac11d8fb441c84a2af83f7274f1ad853fc3f9cf | |
| parent | b1ca335bf54892c59c9fe80d8d71e8763df6bc2e (diff) | |
github-ci: error on any shell errors
Enable `errexit` and `nounset` [POSIX shell options][1]
in `.github/workflows/entrypoint.sh` so that the script fails
if any command within the script fails.
[1]: https://pubs.opengroup.org/onlinepubs/9699919799//utilities/V3_chap02.html#set
Reported-by: Marius Dinu <m95d+git@psihoexpert.ro>
Fixes: https://github.com/openwrt/packages/issues/19953
Signed-off-by: Alois Klink <alois@aloisklink.com>
(cherry picked from commit 03ca0722f73c8121521ff59ca9a4ad6358b6a262)
| -rwxr-xr-x | .github/workflows/entrypoint.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/.github/workflows/entrypoint.sh b/.github/workflows/entrypoint.sh index d7d4ecd..b88a6c1 100755 --- a/.github/workflows/entrypoint.sh +++ b/.github/workflows/entrypoint.sh @@ -1,10 +1,14 @@ #!/bin/sh +# not enabling `errtrace` and `pipefail` since those are bash specific +set -o errexit # failing commands causes script to fail +set -o nounset # undefined variables causes script to fail + mkdir -p /var/lock/ opkg update -[ -n "$CI_HELPER" ] || CI_HELPER="/ci/.github/workflows/ci_helpers.sh" +[ -n "${CI_HELPER:=''}" ] || CI_HELPER="/ci/.github/workflows/ci_helpers.sh" for PKG in /ci/*.ipk; do tar -xzOf "$PKG" ./control.tar.gz | tar xzf - ./control |
