From 1c7c3ac196adf4f192c13e6a66a5eeb09ab8599f Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 22 Mar 2024 15:44:37 +0100 Subject: [PATCH] CI macOS: do not fail on sign if no keys If no signing keys available, the expected behavior is rather to skip signing instead of failing, which is unintended because of shell check for unset variables (set -u). --- .github/scripts/macOS/sign.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/scripts/macOS/sign.sh b/.github/scripts/macOS/sign.sh index 618a2fb19..5d0716e89 100755 --- a/.github/scripts/macOS/sign.sh +++ b/.github/scripts/macOS/sign.sh @@ -29,8 +29,9 @@ set -x APP=${1?Appname must be passed as a first argument} -if [ -z "$KEY_CHAIN" ] || [ -z "$KEY_CHAIN_PASS" ] || - { [ -z "$notarytool_credentials" ] && [ ! $sign_only ]; }; then +if [ -z "${KEY_CHAIN-}" ] || [ -z "${KEY_CHAIN_PASS-}" ] || + { [ -z "${notarytool_credentials-}" ] && [ ! $sign_only ]; } +then echo "Could not find key to sign the application" 2>&1 if [ "$GITHUB_REPOSITORY" = "CESNET/UltraGrid" ] && ! expr "$GITHUB_REF" : refs/pull >/dev/null; then exit 1