Skip to content

Commit caaeda9

Browse files
revert
1 parent 9904ff6 commit caaeda9

3 files changed

Lines changed: 15 additions & 12 deletions

File tree

dist/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57923,13 +57923,19 @@ async function ImportCredentials() {
5792357923
const developerIdApplicationCertificateBase64 = core.getInput('developer-id-application-certificate');
5792457924
if (developerIdApplicationCertificateBase64) {
5792557925
const developerIdApplicationCertificatePassword = core.getInput('developer-id-application-certificate-password');
57926+
if (!developerIdApplicationCertificatePassword) {
57927+
throw new Error('developer-id-application-certificate-password is required when developer-id-application-certificate is provided!');
57928+
}
5792657929
core.info('Importing developer id application certificate...');
5792757930
await importCertificate(keychainPath, tempCredential, developerIdApplicationCertificateBase64.trim(), developerIdApplicationCertificatePassword.trim());
5792857931
installedCertificates = true;
5792957932
}
5793057933
const developerIdInstallerCertificateBase64 = core.getInput('developer-id-installer-certificate');
5793157934
if (developerIdInstallerCertificateBase64) {
5793257935
const developerIdInstallerCertificatePassword = core.getInput('developer-id-installer-certificate-password');
57936+
if (!developerIdInstallerCertificatePassword) {
57937+
throw new Error('developer-id-installer-certificate-password is required when developer-id-installer-certificate is provided!');
57938+
}
5793357939
core.info('Importing developer id installer certificate...');
5793457940
await importCertificate(keychainPath, tempCredential, developerIdInstallerCertificateBase64.trim(), developerIdInstallerCertificatePassword.trim());
5793557941
installedCertificates = true;
@@ -58021,14 +58027,9 @@ async function importCertificate(keychainPath, tempCredential, certificateBase64
5802158027
const certArgs = [
5802258028
'import', certificatePath,
5802358029
'-k', keychainPath,
58030+
'-P', certificatePassword,
5802458031
'-A', '-t', 'cert', '-f', 'pkcs12'
5802558032
];
58026-
if (certificatePassword && certificatePassword.length > 0) {
58027-
certArgs.push('-P', certificatePassword);
58028-
}
58029-
else {
58030-
certArgs.push('-P', '');
58031-
}
5803258033
await exec.exec(security, certArgs);
5803358034
const partitionList = 'apple-tool:,apple:,codesign:';
5803458035
if (core.isDebug()) {

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/AppleCredential.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ export async function ImportCredentials(): Promise<AppleCredential> {
140140
const developerIdApplicationCertificateBase64 = core.getInput('developer-id-application-certificate');
141141
if (developerIdApplicationCertificateBase64) {
142142
const developerIdApplicationCertificatePassword = core.getInput('developer-id-application-certificate-password');
143+
if (!developerIdApplicationCertificatePassword) {
144+
throw new Error('developer-id-application-certificate-password is required when developer-id-application-certificate is provided!');
145+
}
143146
core.info('Importing developer id application certificate...');
144147
await importCertificate(
145148
keychainPath,
@@ -151,6 +154,9 @@ export async function ImportCredentials(): Promise<AppleCredential> {
151154
const developerIdInstallerCertificateBase64 = core.getInput('developer-id-installer-certificate');
152155
if (developerIdInstallerCertificateBase64) {
153156
const developerIdInstallerCertificatePassword = core.getInput('developer-id-installer-certificate-password');
157+
if (!developerIdInstallerCertificatePassword) {
158+
throw new Error('developer-id-installer-certificate-password is required when developer-id-installer-certificate is provided!');
159+
}
154160
core.info('Importing developer id installer certificate...');
155161
await importCertificate(
156162
keychainPath,
@@ -253,13 +259,9 @@ async function importCertificate(keychainPath: string, tempCredential: string, c
253259
const certArgs = [
254260
'import', certificatePath,
255261
'-k', keychainPath,
262+
'-P', certificatePassword,
256263
'-A', '-t', 'cert', '-f', 'pkcs12'
257264
];
258-
if (certificatePassword && certificatePassword.length > 0) {
259-
certArgs.push('-P', certificatePassword);
260-
} else {
261-
certArgs.push('-P', '');
262-
}
263265
await exec.exec(security, certArgs);
264266
const partitionList = 'apple-tool:,apple:,codesign:';
265267
if (core.isDebug()) {

0 commit comments

Comments
 (0)