Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid Toolchain download before cache download #456

5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to hear any suggestions for testing this (i.e. test that a toolchain isn't downloaded)

EDIT: testing via https://github.com/matthewhughes-uw/setup-go-test, looks like I missed something


if (cache && isCacheFeatureAvailable()) {
const packageManager = 'default';
Expand Down