From 30e34d184f2ba28264e711d4e938ee401caa8adc Mon Sep 17 00:00:00 2001 From: Nicholas Ngai Date: Mon, 27 Oct 2025 13:43:21 -0700 Subject: [PATCH] Fall back to downloading from go.dev/dl instead of storage.googleapis.com/golang (#665) * Fall back to downloading from dl.google.com/go instead of storage.googleapis.com/golang * Use go.dev/dl instead --- __tests__/setup-go.test.ts | 4 ++-- dist/setup/index.js | 2 +- src/installer.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/setup-go.test.ts b/__tests__/setup-go.test.ts index 70f2166eb..bdaaaba08 100644 --- a/__tests__/setup-go.test.ts +++ b/__tests__/setup-go.test.ts @@ -368,7 +368,7 @@ describe('setup-go', () => { const expPath = path.win32.join(toolPath, 'bin'); expect(dlSpy).toHaveBeenCalledWith( - 'https://storage.googleapis.com/golang/go1.13.1.windows-amd64.zip', + 'https://go.dev/dl/go1.13.1.windows-amd64.zip', 'C:\\temp\\go1.13.1.windows-amd64.zip', undefined ); @@ -922,7 +922,7 @@ use . const expectedUrl = platform === 'win32' ? `https://github.com/actions/go-versions/releases/download/${version}/go-${version}-${platform}-${arch}.${fileExtension}` - : `https://storage.googleapis.com/golang/go${version}.${osSpec}-${arch}.${fileExtension}`; + : `https://go.dev/dl/go${version}.${osSpec}-${arch}.${fileExtension}`; // ... but not in the local cache findSpy.mockImplementation(() => ''); diff --git a/dist/setup/index.js b/dist/setup/index.js index 9d290efff..f4d69246d 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -103030,7 +103030,7 @@ function getInfoFromDist(versionSpec, arch) { if (!version) { return null; } - const downloadUrl = `https://storage.googleapis.com/golang/${version.files[0].filename}`; + const downloadUrl = `https://go.dev/dl/${version.files[0].filename}`; return { type: 'dist', downloadUrl: downloadUrl, diff --git a/src/installer.ts b/src/installer.ts index 817c334f6..8503e8b0f 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -315,7 +315,7 @@ async function getInfoFromDist( return null; } - const downloadUrl = `https://storage.googleapis.com/golang/${version.files[0].filename}`; + const downloadUrl = `https://go.dev/dl/${version.files[0].filename}`; return { type: 'dist',