From 1776f915f896223c1e0947379df46debacdfb9b5 Mon Sep 17 00:00:00 2001 From: panticmilos Date: Wed, 10 Aug 2022 20:01:22 +0200 Subject: [PATCH] Add get input in main --- dist/setup/index.js | 5 +++-- src/installer.ts | 2 +- src/main.ts | 9 ++++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index dfbf3b3..b1434bd 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -62874,7 +62874,7 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) { } // check cache let toolPath; - toolPath = tc.find('go', versionSpec); + toolPath = tc.find('go', versionSpec, arch); // If not found in cache, download if (toolPath) { core.info(`Found in cache @ ${toolPath}`); @@ -63148,11 +63148,12 @@ function run() { const versionSpec = resolveVersionInput(); const cache = core.getBooleanInput('cache'); core.info(`Setup go version spec ${versionSpec}`); + const arch = core.getInput('architecture'); if (versionSpec) { let token = core.getInput('token'); let auth = !token || cache_utils_1.isGhes() ? undefined : `token ${token}`; const checkLatest = core.getBooleanInput('check-latest'); - const installDir = yield installer.getGo(versionSpec, checkLatest, auth); + const installDir = yield installer.getGo(versionSpec, checkLatest, auth, arch); core.addPath(path_1.default.join(installDir, 'bin')); core.info('Added go to the path'); const version = installer.makeSemver(versionSpec); diff --git a/src/installer.ts b/src/installer.ts index 112ba46..6335dbd 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -55,7 +55,7 @@ export async function getGo( // check cache let toolPath: string; - toolPath = tc.find('go', versionSpec); + toolPath = tc.find('go', versionSpec, arch); // If not found in cache, download if (toolPath) { core.info(`Found in cache @ ${toolPath}`); diff --git a/src/main.ts b/src/main.ts index 0649dec..b7fb133 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,12 +19,19 @@ export async function run() { const cache = core.getBooleanInput('cache'); core.info(`Setup go version spec ${versionSpec}`); + const arch = core.getInput('architecture'); + if (versionSpec) { let token = core.getInput('token'); let auth = !token || isGhes() ? undefined : `token ${token}`; const checkLatest = core.getBooleanInput('check-latest'); - const installDir = await installer.getGo(versionSpec, checkLatest, auth); + const installDir = await installer.getGo( + versionSpec, + checkLatest, + auth, + arch + ); core.addPath(path.join(installDir, 'bin')); core.info('Added go to the path');