diff --git a/src/main.ts b/src/main.ts index d3fb857df..ddd606038 100644 --- a/src/main.ts +++ b/src/main.ts @@ -62,7 +62,10 @@ export async function run() { core.debug(`add bin ${added}`); const goPath = await io.which('go'); - const goVersion = (cp.execSync(`${goPath} version`) || '').toString(); + // run `go version` with the bundled Go toolchain to avoid potentially + // downloading one into the cache + const goVersion = (cp.execSync(`${goPath} version`) || '', + {env: {...process.env, GOTOOLCHAIN: 'local'}}).toString(); if (cache && isCacheFeatureAvailable()) { const packageManager = 'default';