Skip to content

Commit

Permalink
use real version instead of spec
Browse files Browse the repository at this point in the history
  • Loading branch information
e-korolevskii committed Jan 20, 2023
1 parent 2e7414f commit 89d7939
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
10 changes: 5 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ 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
const matchersPath = path.join(__dirname, '../..', 'matchers.json');
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));
Expand Down

0 comments on commit 89d7939

Please sign in to comment.