Skip to content

Commit 5ce0015

Browse files
committed
Fix: Allow all apps to access imported certificate in keychain
- Add the `-A` flag to the `security import` command to allow any application to access the imported certificate's private key. - Update the `set-key-partition-list` to include `codesign:` for non-interactive access on CI. - Add `/usr/bin/security` to the list of trusted tools for the certificate.
1 parent c683793 commit 5ce0015

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/scripts/import_macos_dev_id_cert.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@ security list-keychains -s "$KEYCHAIN_PATH" $(security list-keychains | sed 's/[
1616
security default-keychain -s "$KEYCHAIN_PATH"
1717
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
1818

19-
# Import Developer ID certificate
19+
# Import Developer ID certificate and allow all apps to access the private key
2020
security import "$P12_PATH" \
2121
-k "$KEYCHAIN_PATH" \
2222
-P "$LARGE_SECRET_PASSPHRASE" \
23+
-A \
2324
-T /usr/bin/codesign \
24-
-T /usr/bin/productbuild
25+
-T /usr/bin/productbuild \
26+
-T /usr/bin/security
2527

26-
# Allow non-interactive access for codesign / productbuild / notarytool
28+
# Allow non-interactive access for codesign / productbuild on CI
2729
security set-key-partition-list \
28-
-S apple-tool:,apple: \
30+
-S apple-tool:,apple:,codesign: \
2931
-s \
3032
-k "$KEYCHAIN_PASSWORD" \
3133
"$KEYCHAIN_PATH"

0 commit comments

Comments
 (0)