import-codesign-certs icon indicating copy to clipboard operation
import-codesign-certs copied to clipboard

Add multipe certificates to the keychain

Open Siedlerchr opened this issue 3 years ago • 7 comments

Hi,

I sucessfully used this action together with the java jpackage tool. However, the jpackage creates both a pkg installer and a dmg. And I think I need to add certs for both. So my question is, can I just copy the action or is there an option to add a second cert?

Edit// I just copied the action and specified a password manually for the keychain For the copy I set create keychain to false

Siedlerchr avatar Aug 09 '20 17:08 Siedlerchr

ت

M01O avatar Dec 26 '20 05:12 M01O

I was able to make this work, but needed to specify an explicit password for the temporary keychain otherwise the second invocation could not make use of it.

  • if: runner.os == 'macOS' name: Import Certificate - Application uses: apple-actions/import-codesign-certs@v1 with: keychain-password: YOUR_RANDOM_VALUE_HERE p12-file-base64: ${{ secrets.MAC_APPLICATION_CERTIFICATE_DATA }} p12-password: ${{ secrets.MAC_APPLICATION_CERTIFICATE_PASSPHRASE }} - if: runner.os == 'macOS' name: Import Certificate - Installer uses: apple-actions/import-codesign-certs@v1 with: create-keychain: false # do not create a new keychain for this value keychain-password: YOUR_RANDOM_VALUE_HERE p12-file-base64: ${{ secrets.MAC_INSTALLER_CERTIFICATE_DATA }} p12-password: ${{ secrets.MAC_INSTALLER_CERTIFICATE_PASSPHRASE }}

kellyrob99 avatar Jan 14 '21 19:01 kellyrob99

Yep. That's how I did it as well

Siedlerchr avatar Jan 14 '21 19:01 Siedlerchr

hey guys, how did you manage to add the p12 certificate as a secret if secrets only allows text input and the p12 file is binary data?

L4ZZA avatar Feb 09 '21 11:02 L4ZZA

@L4ZZA You can convert them as base64 text.

openssl base64 -in MyCertificate.p12 -out MyCertificate.txt

lolgear avatar Feb 25 '21 13:02 lolgear

@Siedlerchr Btw, we all didn't read readme properly. It says "import certificates". So, instead of two actions you could just export several certificates as one p12 and import it.

lolgear avatar Feb 26 '21 10:02 lolgear

@lolgear Ah didn't know about that this works as well. Next time I will try this

Siedlerchr avatar Feb 26 '21 13:02 Siedlerchr