Skip to content

Commit 3c84470

Browse files
bugs
1 parent dc575ee commit 3c84470

5 files changed

Lines changed: 11 additions & 10 deletions

File tree

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'Setup Go environment'
2-
description: 'Setup a Go environment and add it to the PATH, additionally providing proxy support'
2+
description: 'Setup a Go environment and add it to the PATH'
33
author: 'GitHub'
44
inputs:
55
go-version:

dist/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,9 @@ function run() {
12871287
// If not supplied then problem matchers will still be setup. Useful for self-hosted.
12881288
//
12891289
let versionSpec = core.getInput('go-version');
1290-
let stable = (core.getInput('stable') || '').toUpperCase() == 'TRUE';
1290+
// stable will be true unless false is the exact input
1291+
// since getting unstable versions should be explicit
1292+
let stable = Boolean(core.getInput('stable') || 'true');
12911293
if (versionSpec) {
12921294
let installDir = tc.find('go', versionSpec);
12931295
if (!installDir) {
@@ -4588,7 +4590,7 @@ function downloadGo(versionSpec, stable) {
45884590
let match = yield findMatch(versionSpec, stable);
45894591
if (match) {
45904592
// download
4591-
let downloadUrl = `https://storage.googleapis.com/golang/${match.files[0]}`;
4593+
let downloadUrl = `https://storage.googleapis.com/golang/${match.files[0].filename}`;
45924594
let downloadPath = yield tc.downloadTool(downloadUrl);
45934595
// extract
45944596
let extPath = sys.getPlatform() == 'windows'
@@ -4628,7 +4630,6 @@ function findMatch(versionSpec, stable) {
46284630
if (parts.length == 2) {
46294631
version = version + '.0';
46304632
}
4631-
//console.log(version, versionSpec);
46324633
if (semver.satisfies(version, versionSpec) && candidate.stable == stable) {
46334634
goFile = candidate.files.find(file => {
46344635
return file.arch === archFilter && file.os === platFilter;

lib/installer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function downloadGo(versionSpec, stable) {
2727
let match = yield findMatch(versionSpec, stable);
2828
if (match) {
2929
// download
30-
let downloadUrl = `https://storage.googleapis.com/golang/${match.files[0]}`;
30+
let downloadUrl = `https://storage.googleapis.com/golang/${match.files[0].filename}`;
3131
let downloadPath = yield tc.downloadTool(downloadUrl);
3232
// extract
3333
let extPath = sys.getPlatform() == 'windows'
@@ -67,7 +67,6 @@ function findMatch(versionSpec, stable) {
6767
if (parts.length == 2) {
6868
version = version + '.0';
6969
}
70-
//console.log(version, versionSpec);
7170
if (semver.satisfies(version, versionSpec) && candidate.stable == stable) {
7271
goFile = candidate.files.find(file => {
7372
return file.arch === archFilter && file.os === platFilter;

src/installer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function downloadGo(
1515

1616
if (match) {
1717
// download
18-
let downloadUrl: string = `https://storage.googleapis.com/golang/${match.files[0]}`;
18+
let downloadUrl: string = `https://storage.googleapis.com/golang/${match.files[0].filename}`;
1919
let downloadPath: string = await tc.downloadTool(downloadUrl);
2020

2121
// extract
@@ -80,7 +80,6 @@ export async function findMatch(
8080
version = version + '.0';
8181
}
8282

83-
//console.log(version, versionSpec);
8483
if (semver.satisfies(version, versionSpec) && candidate.stable == stable) {
8584
goFile = candidate.files.find(file => {
8685
return file.arch === archFilter && file.os === platFilter;

src/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ export async function run() {
1010
// If not supplied then problem matchers will still be setup. Useful for self-hosted.
1111
//
1212
let versionSpec = core.getInput('go-version');
13-
let stable: boolean =
14-
(core.getInput('stable') || '').toUpperCase() == 'TRUE';
13+
14+
// stable will be true unless false is the exact input
15+
// since getting unstable versions should be explicit
16+
let stable = Boolean(core.getInput('stable') || 'true');
1517

1618
if (versionSpec) {
1719
let installDir: string | undefined = tc.find('go', versionSpec);

0 commit comments

Comments
 (0)