fix: deterministic exit code for missing Komodo env vars
test / komodo-deploy-script (push) Successful in 16s
ci / docker (push) Successful in 48s
test / komodo-deploy-script (pull_request) Successful in 16s

':?' exits 1 under bash but 2 under dash (the Ubuntu runner's sh),
so the two missing-variable tests failed in CI while passing locally.
Replace with explicit checks so every failure path exits 1.
This commit is contained in:
Jonathan Branan committed 2026-10-27 00:16:51 -05:00
1 parent 003217a2b8
commit b2b8f6c10d
1 file changed
+14 -3
+14 -3
View File
@@ -34,9 +34,20 @@ if [ -z "${KOMODO_TARGET:-}" ]; then
exit 0 exit 0
fi fi
: "${KOMODO_URL:?KOMODO_URL is required}" # Explicit checks rather than ':?', whose exit status differs between
: "${KOMODO_API_KEY:?KOMODO_API_KEY is required}" # shells (bash exits 1, dash exits 2). Keep every failure path at exit 1.
: "${KOMODO_API_SECRET:?KOMODO_API_SECRET is required}" if [ -z "${KOMODO_URL:-}" ]; then
echo "::error::KOMODO_URL is required" >&2
exit 1
fi
if [ -z "${KOMODO_API_KEY:-}" ]; then
echo "::error::KOMODO_API_KEY is required" >&2
exit 1
fi
if [ -z "${KOMODO_API_SECRET:-}" ]; then
echo "::error::KOMODO_API_SECRET is required" >&2
exit 1
fi
# Normalise: strip any trailing slash so path joins are predictable. # Normalise: strip any trailing slash so path joins are predictable.
KOMODO_URL="${KOMODO_URL%/}" KOMODO_URL="${KOMODO_URL%/}"