Skip to content

Commit e1038c1

Browse files
committed
fix: Handle compressed/noncompressed keys reliably
1 parent d9471c4 commit e1038c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async function setupKeys() {
8181
let path = await toolCache.downloadTool("https://swift.org/keys/all-keys.asc");
8282
core.debug("Examining verification keys");
8383
await (0, exec_1.exec)(`file "${path}"`);
84-
const isPlaintext = await (0, exec_1.exec)(`gunzip --test "${path}"`, undefined, { silent: true });
84+
const isPlaintext = await (0, exec_1.exec)(`gunzip --test "${path}"`, undefined, { silent: true, ignoreReturnCode: true });
8585
core.debug("Importing verification keys");
8686
await (0, exec_1.exec)('bash', ['-c', `${isPlaintext ? "cat" : "zcat"} "${path}" | gpg --import`]);
8787
core.debug("Refreshing keys");

src/gpg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export async function setupKeys() {
1010

1111
core.debug("Examining verification keys");
1212
await exec(`file "${path}"`);
13-
const isPlaintext = await exec(`gunzip --test "${path}"`, undefined, { silent: true });
13+
const isPlaintext = await exec(`gunzip --test "${path}"`, undefined, { silent: true, ignoreReturnCode: true });
1414

1515
core.debug("Importing verification keys");
1616
await exec('bash', ['-c', `${isPlaintext ? "cat" : "zcat"} "${path}" | gpg --import`]);

0 commit comments

Comments
 (0)