Skip to content

Commit fdc0d67

Browse files
Add Go bin if go-version input is empty (#351)
1 parent ebfdf6a commit fdc0d67

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

dist/setup/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -63605,13 +63605,13 @@ function run() {
6360563605
core.info('Setting GOROOT for Go version < 1.9');
6360663606
core.exportVariable('GOROOT', installDir);
6360763607
}
63608-
const added = yield addBinToPath();
63609-
core.debug(`add bin ${added}`);
6361063608
core.info(`Successfully set up Go version ${versionSpec}`);
6361163609
}
6361263610
else {
6361363611
core.info('[warning]go-version input was not specified. The action will try to use pre-installed version.');
6361463612
}
63613+
const added = yield addBinToPath();
63614+
core.debug(`add bin ${added}`);
6361563615
const goPath = yield io.which('go');
6361663616
const goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString();
6361763617
if (cache && cache_utils_1.isCacheFeatureAvailable()) {

src/main.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ export async function run() {
5151
core.exportVariable('GOROOT', installDir);
5252
}
5353

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

61+
const added = await addBinToPath();
62+
core.debug(`add bin ${added}`);
63+
6364
const goPath = await io.which('go');
6465
const goVersion = (cp.execSync(`${goPath} version`) || '').toString();
6566

0 commit comments

Comments
 (0)