Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,11 @@ const toolCache = __importStar(__nccwpck_require__(7784));
async function setupKeys() {
core.debug("Fetching verification keys");
let path = await toolCache.downloadTool("https://swift.org/keys/all-keys.asc");
core.debug("Examining verification keys");
await (0, exec_1.exec)(`file "${path}"`);
const isPlaintext = await (0, exec_1.exec)(`gunzip --test "${path}"`, undefined, { silent: true, ignoreReturnCode: true });
core.debug("Importing verification keys");
await (0, exec_1.exec)(`gpg --import "${path}"`);
await (0, exec_1.exec)('bash', ['-c', `${isPlaintext ? "cat" : "zcat"} "${path}" | gpg --import`]);
core.debug("Refreshing keys");
await refreshKeys();
}
Expand Down
6 changes: 5 additions & 1 deletion src/gpg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ export async function setupKeys() {
"https://swift.org/keys/all-keys.asc"
);

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

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

core.debug("Refreshing keys");
await refreshKeys();
Expand Down