Skip to content

Commit

Permalink
Add Go bin if go-version input is empty (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-shibanov committed Mar 14, 2023
1 parent ebfdf6a commit fdc0d67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/setup/index.js
Expand Up @@ -63605,13 +63605,13 @@ function run() {
core.info('Setting GOROOT for Go version < 1.9');
core.exportVariable('GOROOT', installDir);
}
const added = yield addBinToPath();
core.debug(`add bin ${added}`);
core.info(`Successfully set up Go version ${versionSpec}`);
}
else {
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 goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
if (cache && cache_utils_1.isCacheFeatureAvailable()) {
Expand Down
5 changes: 3 additions & 2 deletions src/main.ts
Expand Up @@ -51,15 +51,16 @@ export async function run() {
core.exportVariable('GOROOT', installDir);
}

const added = await addBinToPath();
core.debug(`add bin ${added}`);
core.info(`Successfully set up Go version ${versionSpec}`);
} else {
core.info(
'[warning]go-version input was not specified. The action will try to use pre-installed version.'
);
}

const added = await addBinToPath();
core.debug(`add bin ${added}`);

const goPath = await io.which('go');
const goVersion = (cp.execSync(`${goPath} version`) || '').toString();

Expand Down

0 comments on commit fdc0d67

Please sign in to comment.