From a02bf28b8a5b4a6b1c25e0490d2e83c9488da3db Mon Sep 17 00:00:00 2001 From: Matthew Hughes Date: Thu, 8 Feb 2024 10:46:30 +0000 Subject: [PATCH] !drop build so I can test the action --- dist/setup/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 25798cc..e875ffd 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -61817,7 +61817,10 @@ function run() { const added = yield addBinToPath(); core.debug(`add bin ${added}`); const goPath = yield io.which('go'); - const goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString(); + // run `go version` with the bundled Go toolchain to avoid potentially + // downloading one into the cache + const goVersion = (child_process_1.default.execSync(`${goPath} version`) || '', + { env: Object.assign(Object.assign({}, process.env), { GOTOOLCHAIN: 'local' }) }).toString(); if (cache && cache_utils_1.isCacheFeatureAvailable()) { const packageManager = 'default'; const cacheDependencyPath = core.getInput('cache-dependency-path'); @@ -61854,7 +61857,9 @@ function addBinToPath() { core.debug('go not in the path'); return added; } - const buf = child_process_1.default.execSync('go env GOPATH'); + const buf = child_process_1.default.execSync('go env GOPATH', { + env: Object.assign(Object.assign({}, process.env), { GOTOOLCHAIN: 'local' }) + }); if (buf.length > 1) { const gp = buf.toString().trim(); core.debug(`go env GOPATH :${gp}:`);