Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit d5eb382

Browse files
committed
No hard fail on missing credentials
1 parent 617e52a commit d5eb382

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

hack/notarize.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ OUTPUT="${2:?missing output argument}"
1111
# This script MUST produce an output file or fail.
1212
case "$(basename "$FILE")" in
1313
"redskyctl-darwin-amd64.tar.gz")
14-
# Do nothing, just fall through to the notarization bit (the "signature file" will contain the request UUID)
14+
# If there are no credentials, just produce an empty file (otherwise fall through)
15+
if [ -n "${AC_USERNAME:-}" ] || [ -n "${AC_PASSWORD:-}" ] ; then
16+
touch "${OUTPUT}"
17+
exit
18+
fi
1519
;;
1620
"checksums.txt")
1721
# Sign the checksums using GPG (mimic the default GoReleaser behavior)
@@ -29,8 +33,6 @@ esac
2933
command -v ditto >/dev/null 2>&1 || { echo >&2 "notarization failed, ditto not present"; exit 1; }
3034
command -v xcrun >/dev/null 2>&1 || { echo >&2 "notarization failed, xcrun not present"; exit 1; }
3135
command -v jq >/dev/null 2>&1 || { echo >&2 "notarization failed, jq not present"; exit 1; }
32-
[ -n "${AC_USERNAME:-}" ] || { echo >&2 "notarization failed, no credentials"; exit 1; }
33-
[ -n "${AC_PASSWORD:-}" ] || { echo >&2 "notarization failed, no credentials"; exit 1; }
3436

3537
# Create a temporary location to perform notarization
3638
NAME="$(basename "$FILE" ".tar.gz")"

0 commit comments

Comments
 (0)