From 33e64ee8920d296d4eac1785a3a01ac69a66b9b0 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Mon, 20 Jul 2026 00:05:01 +0800 Subject: [PATCH] Validate signing identity import in release workflow before binary signing --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0442fc..5f487c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -195,7 +195,10 @@ jobs: security set-keychain-settings -lut 21600 "$keychain_path" security unlock-keychain -p "$keychain_password" "$keychain_path" security import "$certificate_path" -k "$keychain_path" -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$keychain_password" "$keychain_path" + if ! security find-identity -v -p codesigning "$keychain_path" | grep -F -- "$APPLE_SIGNING_IDENTITY"; then + echo "Signing identity was not imported into the temporary keychain" >&2 + exit 1 + fi codesign --force --options runtime --timestamp --sign "$APPLE_SIGNING_IDENTITY" --keychain "$keychain_path" "$binary" codesign --verify --strict --verbose=2 "$binary"