Add Go bin if go-version input is empty (#351)
This commit is contained in:
parent
ebfdf6ac95
commit
fdc0d672a1
4
dist/setup/index.js
vendored
4
dist/setup/index.js
vendored
@ -63605,13 +63605,13 @@ function run() {
|
|||||||
core.info('Setting GOROOT for Go version < 1.9');
|
core.info('Setting GOROOT for Go version < 1.9');
|
||||||
core.exportVariable('GOROOT', installDir);
|
core.exportVariable('GOROOT', installDir);
|
||||||
}
|
}
|
||||||
const added = yield addBinToPath();
|
|
||||||
core.debug(`add bin ${added}`);
|
|
||||||
core.info(`Successfully set up Go version ${versionSpec}`);
|
core.info(`Successfully set up Go version ${versionSpec}`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.info('[warning]go-version input was not specified. The action will try to use pre-installed version.');
|
core.info('[warning]go-version input was not specified. The action will try to use pre-installed version.');
|
||||||
}
|
}
|
||||||
|
const added = yield addBinToPath();
|
||||||
|
core.debug(`add bin ${added}`);
|
||||||
const goPath = yield io.which('go');
|
const goPath = yield io.which('go');
|
||||||
const goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
|
const goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
|
||||||
if (cache && cache_utils_1.isCacheFeatureAvailable()) {
|
if (cache && cache_utils_1.isCacheFeatureAvailable()) {
|
||||||
|
@ -51,8 +51,6 @@ export async function run() {
|
|||||||
core.exportVariable('GOROOT', installDir);
|
core.exportVariable('GOROOT', installDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
const added = await addBinToPath();
|
|
||||||
core.debug(`add bin ${added}`);
|
|
||||||
core.info(`Successfully set up Go version ${versionSpec}`);
|
core.info(`Successfully set up Go version ${versionSpec}`);
|
||||||
} else {
|
} else {
|
||||||
core.info(
|
core.info(
|
||||||
@ -60,6 +58,9 @@ export async function run() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const added = await addBinToPath();
|
||||||
|
core.debug(`add bin ${added}`);
|
||||||
|
|
||||||
const goPath = await io.which('go');
|
const goPath = await io.which('go');
|
||||||
const goVersion = (cp.execSync(`${goPath} version`) || '').toString();
|
const goVersion = (cp.execSync(`${goPath} version`) || '').toString();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user