From aba34aa03da20a97c5d3dd514e28f4ad0de7fd93 Mon Sep 17 00:00:00 2001 From: Masahiro Furudate <178inaba.git@gmail.com> Date: Sat, 6 Apr 2024 03:00:41 +0900 Subject: [PATCH 1/3] Fix golang download url to go.dev --- src/installer.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index 9402a83..cfa14f5 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -18,6 +18,8 @@ const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/$ type InstallationType = 'dist' | 'manifest'; +const golangDownloadUrl = 'https://go.dev/dl/?mode=json&include=all'; + export interface IGoVersionFile { filename: string; // darwin, linux, windows @@ -409,9 +411,8 @@ export async function findMatch( let result: IGoVersion | undefined; let match: IGoVersion | undefined; - const dlUrl = 'https://golang.org/dl/?mode=json&include=all'; const candidates: IGoVersion[] | null = await module.exports.getVersionsDist( - dlUrl + golangDownloadUrl ); if (!candidates) { throw new Error(`golang download url did not return results`); @@ -527,9 +528,8 @@ async function resolveStableVersionDist( ) { const archFilter = sys.getArch(arch); const platFilter = sys.getPlatform(); - const dlUrl = 'https://golang.org/dl/?mode=json&include=all'; const candidates: IGoVersion[] | null = await module.exports.getVersionsDist( - dlUrl + golangDownloadUrl ); if (!candidates) { throw new Error(`golang download url did not return results`); From a5261d2f4a9684249cb350ad59ad2fe24adf1470 Mon Sep 17 00:00:00 2001 From: Masahiro Furudate <178inaba.git@gmail.com> Date: Sat, 13 Apr 2024 23:44:39 +0900 Subject: [PATCH 2/3] Fix const name --- src/installer.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index cfa14f5..15e665d 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -18,7 +18,7 @@ const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/$ type InstallationType = 'dist' | 'manifest'; -const golangDownloadUrl = 'https://go.dev/dl/?mode=json&include=all'; +const GOLANG_DOWNLOAD_URL = 'https://go.dev/dl/?mode=json&include=all'; export interface IGoVersionFile { filename: string; @@ -412,7 +412,7 @@ export async function findMatch( let match: IGoVersion | undefined; const candidates: IGoVersion[] | null = await module.exports.getVersionsDist( - golangDownloadUrl + GOLANG_DOWNLOAD_URL ); if (!candidates) { throw new Error(`golang download url did not return results`); @@ -529,7 +529,7 @@ async function resolveStableVersionDist( const archFilter = sys.getArch(arch); const platFilter = sys.getPlatform(); const candidates: IGoVersion[] | null = await module.exports.getVersionsDist( - golangDownloadUrl + GOLANG_DOWNLOAD_URL ); if (!candidates) { throw new Error(`golang download url did not return results`); From aacd71ffa61a1af79bdef6fda233bbb4496017dc Mon Sep 17 00:00:00 2001 From: Masahiro Furudate <178inaba.git@gmail.com> Date: Sat, 13 Apr 2024 23:46:49 +0900 Subject: [PATCH 3/3] Run `npm run build` --- dist/setup/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 5124c96..dfe7a4f 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -49585,6 +49585,7 @@ const MANIFEST_REPO_OWNER = 'actions'; const MANIFEST_REPO_NAME = 'go-versions'; const MANIFEST_REPO_BRANCH = 'main'; const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`; +const GOLANG_DOWNLOAD_URL = 'https://go.dev/dl/?mode=json&include=all'; function getGo(versionSpec_1, checkLatest_1, auth_1) { return __awaiter(this, arguments, void 0, function* (versionSpec, checkLatest, auth, arch = os_1.default.arch()) { var _a; @@ -49846,8 +49847,7 @@ function findMatch(versionSpec_1) { const platFilter = sys.getPlatform(); let result; let match; - const dlUrl = 'https://golang.org/dl/?mode=json&include=all'; - const candidates = yield module.exports.getVersionsDist(dlUrl); + const candidates = yield module.exports.getVersionsDist(GOLANG_DOWNLOAD_URL); if (!candidates) { throw new Error(`golang download url did not return results`); } @@ -49937,8 +49937,7 @@ function resolveStableVersionDist(versionSpec, arch) { return __awaiter(this, void 0, void 0, function* () { const archFilter = sys.getArch(arch); const platFilter = sys.getPlatform(); - const dlUrl = 'https://golang.org/dl/?mode=json&include=all'; - const candidates = yield module.exports.getVersionsDist(dlUrl); + const candidates = yield module.exports.getVersionsDist(GOLANG_DOWNLOAD_URL); if (!candidates) { throw new Error(`golang download url did not return results`); }