Skip to content

Commit 7849873

Browse files
committed
Update gpg handling
1 parent 9005990 commit 7849873

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/core/gpg.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { exec } from "@actions/exec";
22
import * as core from "@actions/core";
33
import * as toolCache from "@actions/tool-cache";
4-
import { OS, System } from "./os";
4+
import { OS } from "./os";
55

6-
export async function setupKeys(system: System) {
6+
export async function setupKeys(os: OS) {
77
core.debug("Fetching verification keys");
88
let path = await toolCache.downloadTool(
99
"https://swift.org/keys/all-keys.asc",
1010
);
1111

12-
if (system.os === OS.Ubuntu || system.os === OS.MacOS) {
12+
if (os === 'linux' || os === 'darwin') {
1313
core.debug("Examining verification keys");
1414
await exec(`file "${path}"`);
1515
const isPlaintext = await exec(`gunzip --test "${path}"`, undefined, {
@@ -24,7 +24,7 @@ export async function setupKeys(system: System) {
2424
]);
2525
}
2626

27-
if (system.os === OS.Windows) {
27+
if (os === 'win32') {
2828
core.debug("Importing verification keys");
2929
await exec(`gpg --import "${path}"`);
3030
}

src/core/os.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ export async function getOS() {
99

1010
return detectedSystem.os;
1111
}
12+
13+
export type OS = getos.Os["os"];

0 commit comments

Comments
 (0)