Skip to content

fix: work around electron-builder keychain partition-list bug - #81

Merged
afitzgerald merged 1 commit into
mainfrom
alan/fix-keychain-signing
Sep 6, 2026
Merged

afitzgerald merged 1 commit into
mainfrom
alan/fix-keychain-signing

Conversation

@afitzgerald

Copy link
Copy Markdown
Owner

Summary

  • CSC_LINK-based signing has been failing with security: SecKeychainUnlock: The user name or passphrase you entered is not correct regardless of the cert/password being correct.
  • Root cause: electron-builder 26.15/26.16's createKeychain() generates a random unlock password for the temp keychain, but its set-key-partition-list -k call passes CSC_KEY_PASSWORD (the cert's import password) instead — a real upstream bug (electron-userland/electron-builder#10066), fixed upstream but not yet in a published npm release.
  • Works around it by importing the certificate ourselves via apple-actions/import-codesign-certs (which does the create/import/partition-list sequence correctly), then dropping CSC_LINK/CSC_KEY_PASSWORD from the yarn dist env so electron-builder auto-discovers the already-imported identity instead of handling the keychain itself.

Test plan

  • Re-run the Release workflow for v0.0.5 after merge and confirm the "Build, sign, notarize, and publish the DMG" step gets past code signing
  • Confirm the .dmg/.zip land on the GitHub release and brew install --cask afitzgerald/diffier/diffier works

electron-builder 26.15/26.16's CSC_LINK handling creates a temp
keychain with a random unlock password, but passes CSC_KEY_PASSWORD
(the cert's import password) to `set-key-partition-list -k` instead
of that keychain password — so signing always fails with
"SecKeychainUnlock: The user name or passphrase you entered is not
correct", regardless of whether the cert/password are correct
(electron-userland/electron-builder#10066, fixed upstream but not yet
in a published release).

Import the certificate ourselves via apple-actions/import-codesign-certs
instead, and let electron-builder auto-discover the identity, sidestepping
its broken keychain path entirely.
@afitzgerald
afitzgerald merged commit 6058827 into main Sep 6, 2026
1 check passed
@afitzgerald
afitzgerald deleted the alan/fix-keychain-signing branch September 6, 2026 01:58
afitzgerald added a commit that referenced this pull request Sep 30, 2026
fix: work around electron-builder keychain partition-list bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant