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).
This commit is contained in:
Martin Pulec
2024-03-22 15:44:37 +01:00
parent a66ee61564
commit 1c7c3ac196

View File

@@ -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