capture and pass along exit code in case of failures

This commit is contained in:
Emil Lerch 2023-03-27 21:27:33 -07:00
parent ecf1ab5376
commit 72ad4c61b4
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -21,9 +21,17 @@ while IFS= read -r f; do
-v "${PWD}":/home/user \ -v "${PWD}":/home/user \
git.lerch.org/lobo/pkcs11:1 \ git.lerch.org/lobo/pkcs11:1 \
-s --id "${INPUT_SLOT}" -m SHA256-RSA-PKCS -i "$f" -o "${dest_sig}" --pin env:INPUT_USER_PIN -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 if [ -n "${INPUT_PUBLIC_KEY}" ]; then
echo "Public key specified. Uploading to sigstore public transparency log" echo "Public key specified. Uploading to sigstore public transparency log"
rekor upload --artifact "$f" --signature "${dest_sig}" --pki-format x509 --public-key public_key rekor upload --artifact "$f" --signature "${dest_sig}" --pki-format x509 --public-key public_key
ec=$?
if [ $ec -ne 0 ]; then
exit $ec
fi
fi fi
done <<ALLFILES_INPUT done <<ALLFILES_INPUT
$all_files $all_files