From b2b8f6c10d840fbc7caaa7f9a41b0cddb13d9a96 Mon Sep 17 00:00:00 2001 From: Jonathan Branan Date: Tue, 27 Oct 2026 00:16:51 -0500 Subject: [PATCH] fix: deterministic exit code for missing Komodo env vars ':?' 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. --- .gitea/scripts/komodo-deploy.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.gitea/scripts/komodo-deploy.sh b/.gitea/scripts/komodo-deploy.sh index 3168499..90415ec 100755 --- a/.gitea/scripts/komodo-deploy.sh +++ b/.gitea/scripts/komodo-deploy.sh @@ -34,9 +34,20 @@ if [ -z "${KOMODO_TARGET:-}" ]; then exit 0 fi -: "${KOMODO_URL:?KOMODO_URL is required}" -: "${KOMODO_API_KEY:?KOMODO_API_KEY is required}" -: "${KOMODO_API_SECRET:?KOMODO_API_SECRET is required}" +# Explicit checks rather than ':?', whose exit status differs between +# shells (bash exits 1, dash exits 2). Keep every failure path at exit 1. +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. KOMODO_URL="${KOMODO_URL%/}"