From 7a4bf15d5df2451b1fbfff8b6fa55fab412f48b1 Mon Sep 17 00:00:00 2001 From: Frederik Wallner Date: Wed, 3 Jul 2024 10:51:24 +0200 Subject: [PATCH] Signature file seems to not be used for windows --- src/gpg.ts | 4 ++-- src/linux-install.ts | 2 +- src/windows-install.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) 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 }; }