From 72ad4c61b48423079fb8ce357fd005f9163bd824 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Mon, 27 Mar 2023 21:27:33 -0700 Subject: [PATCH] capture and pass along exit code in case of failures --- entrypoint.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 270de3f..e59aae7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,9 +21,17 @@ while IFS= read -r f; do -v "${PWD}":/home/user \ git.lerch.org/lobo/pkcs11:1 \ -s --id "${INPUT_SLOT}" -m SHA256-RSA-PKCS -i "$f" -o "${dest_sig}" --pin env:INPUT_USER_PIN + ec=$? + if [ $ec -ne 0 ]; then + exit $ec + fi if [ -n "${INPUT_PUBLIC_KEY}" ]; then echo "Public key specified. Uploading to sigstore public transparency log" rekor upload --artifact "$f" --signature "${dest_sig}" --pki-format x509 --public-key public_key + ec=$? + if [ $ec -ne 0 ]; then + exit $ec + fi fi done <