use real version instead of spec

This commit is contained in:
Evgenii Korolevskii 2023-01-20 01:28:58 +01:00
parent 2e7414f276
commit 89d7939d38
2 changed files with 9 additions and 10 deletions

9
dist/setup/index.js vendored
View file

@ -63602,19 +63602,18 @@ function run() {
core.debug(`add bin ${added}`);
core.info(`Successfully set up Go version ${versionSpec}`);
}
let goPath = yield io.which('go');
let goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
if (cache && cache_utils_1.isCacheFeatureAvailable()) {
const packageManager = 'default';
const cacheDependencyPath = core.getInput('cache-dependency-path');
let goPath = yield io.which('go');
core.info(`Version spec is ${versionSpec}, go path is ${goPath}`);
yield cache_restore_1.restoreCache(versionSpec, packageManager, cacheDependencyPath);
core.info(`Version spec is ${versionSpec}, go version is ${goVersion}`);
yield cache_restore_1.restoreCache(goVersion, packageManager, cacheDependencyPath);
}
// add problem matchers
const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json');
core.info(`##[add-matcher]${matchersPath}`);
// output the version actually being used
let goPath = yield io.which('go');
let goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
core.info(goVersion);
core.setOutput('go-version', parseGoVersion(goVersion));
core.startGroup('go env');

View file

@ -56,12 +56,14 @@ export async function run() {
core.info(`Successfully set up Go version ${versionSpec}`);
}
let goPath = await io.which('go');
let goVersion = (cp.execSync(`${goPath} version`) || '').toString();
if (cache && isCacheFeatureAvailable()) {
const packageManager = 'default';
const cacheDependencyPath = core.getInput('cache-dependency-path');
let goPath = await io.which('go');
core.info(`Version spec is ${versionSpec}, go path is ${goPath}`)
await restoreCache(versionSpec, packageManager, cacheDependencyPath);
core.info(`Version spec is ${versionSpec}, go version is ${goVersion}`)
await restoreCache(goVersion, packageManager, cacheDependencyPath);
}
// add problem matchers
@ -69,8 +71,6 @@ export async function run() {
core.info(`##[add-matcher]${matchersPath}`);
// output the version actually being used
let goPath = await io.which('go');
let goVersion = (cp.execSync(`${goPath} version`) || '').toString();
core.info(goVersion);
core.setOutput('go-version', parseGoVersion(goVersion));