diff --git a/src/gpg.ts b/src/gpg.ts index 8a69ad87..173a0a20 100644 --- a/src/gpg.ts +++ b/src/gpg.ts @@ -15,9 +15,9 @@ export async function setupKeys() { await refreshKeys(); } -export async function verify(signaturePath: string, packagePath: string) { +export async function verify(...paths: string[]) { core.debug("Verifying signature"); - await exec("gpg", ["--verify", signaturePath, packagePath]); + await exec("gpg", ["--verify", ...paths]); } export async function refreshKeys() { diff --git a/src/linux-install.ts b/src/linux-install.ts index e57bf185..fa33045e 100644 --- a/src/linux-install.ts +++ b/src/linux-install.ts @@ -23,7 +23,7 @@ export async function install(version: string, system: System) { const swiftPkg = swiftPackage(version, system); let { pkg, signature } = await download(swiftPkg); - await verify(signature, pkg); + await verify(pkg, signature); swiftPath = await unpack(pkg, swiftPkg.name, version, system); } else { diff --git a/src/windows-install.ts b/src/windows-install.ts index 9e537697..fd0f50f3 100644 --- a/src/windows-install.ts +++ b/src/windows-install.ts @@ -23,8 +23,8 @@ export async function install(version: string, system: System) { await setupKeys(); - let { exe, signature } = await download(swiftPkg); - await verify(signature, exe); + let { exe } = await download(swiftPkg); + await verify(exe); const exePath = await toolCache.cacheFile( exe, @@ -80,11 +80,11 @@ export async function install(version: string, system: System) { async function download({ url, name }: Package) { core.debug("Downloading Swift for windows"); - let [exe, signature] = await Promise.all([ + let [exe] = await Promise.all([ toolCache.downloadTool(url), toolCache.downloadTool(`${url}.sig`), ]); core.debug("Swift download complete"); - return { exe, signature, name }; + return { exe, name }; }