From 107f2fc644a553c40bf823f79e8934beb9c8201f Mon Sep 17 00:00:00 2001 From: George Adams Date: Fri, 13 Feb 2026 15:51:56 +0000 Subject: [PATCH] run prettier --- .github/workflows/microsoft-validation.yml | 9 +++------ README.md | 2 +- __tests__/setup-go.test.ts | 7 ++----- action.yml | 2 +- src/installer.ts | 12 ++---------- 5 files changed, 9 insertions(+), 23 deletions(-) diff --git a/.github/workflows/microsoft-validation.yml b/.github/workflows/microsoft-validation.yml index eb76585..76eb9ec 100644 --- a/.github/workflows/microsoft-validation.yml +++ b/.github/workflows/microsoft-validation.yml @@ -10,9 +10,6 @@ on: paths-ignore: - '**.md' -env: - MICROSOFT_GO_BASE_URL: 'https://aka.ms/golang/release/latest' - jobs: microsoft-basic: name: 'Microsoft build of Go ${{ matrix.go-version }} on ${{ matrix.os }}' @@ -29,7 +26,7 @@ jobs: uses: ./ with: go-version: ${{ matrix.go-version }} - go-download-base-url: ${{ env.MICROSOFT_GO_BASE_URL }} + go-download-base-url: 'https://aka.ms/golang/release/latest' cache: false - name: Verify Go installation @@ -104,7 +101,7 @@ jobs: uses: ./ with: go-version: '1.25' - go-download-base-url: ${{ env.MICROSOFT_GO_BASE_URL }} + go-download-base-url: 'https://aka.ms/golang/release/latest' architecture: ${{ matrix.architecture }} cache: false @@ -125,7 +122,7 @@ jobs: uses: ./ with: go-version: '1.25' - go-download-base-url: ${{ env.MICROSOFT_GO_BASE_URL }} + go-download-base-url: 'https://aka.ms/golang/release/latest' cache: true - name: Verify Go installation diff --git a/README.md b/README.md index b43aa8c..32c86d7 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ See [action.yml](action.yml). # Architecture to install (auto-detected if not specified) architecture: 'x64' - # Custom base URL for Go downloads (e.g., for mirrors or Microsoft Go) + # Custom base URL for Go downloads (e.g., for mirrors) go-download-base-url: '' ``` diff --git a/__tests__/setup-go.test.ts b/__tests__/setup-go.test.ts index 2ce8fcf..f83d6a3 100644 --- a/__tests__/setup-go.test.ts +++ b/__tests__/setup-go.test.ts @@ -129,8 +129,9 @@ describe('setup-go', () => { }); afterEach(() => { - // clear out env var set during 'run' + // clear out env vars set during 'run' delete process.env[im.GOTOOLCHAIN_ENV_VAR]; + delete process.env['GO_DOWNLOAD_BASE_URL']; //jest.resetAllMocks(); jest.clearAllMocks(); @@ -1272,8 +1273,6 @@ use . `Using custom Go download base URL: ${customBaseUrl}` ); expect(logSpy).toHaveBeenCalledWith('Install from custom download URL'); - - delete process.env['GO_DOWNLOAD_BASE_URL']; }); it('input takes precedence over environment variable', async () => { @@ -1302,8 +1301,6 @@ use . expect(logSpy).toHaveBeenCalledWith( `Acquiring go1.13.1 from ${inputUrl}/go1.13.1.linux-amd64.tar.gz` ); - - delete process.env['GO_DOWNLOAD_BASE_URL']; }); it('errors when stable alias is used with custom URL', async () => { diff --git a/action.yml b/action.yml index 0052528..74a4e7e 100644 --- a/action.yml +++ b/action.yml @@ -20,7 +20,7 @@ inputs: architecture: description: 'Target architecture for Go to use. Examples: x86, x64. Will use system architecture by default.' go-download-base-url: - description: 'Custom base URL for downloading Go distributions. Use this to download Go from a mirror or custom source (e.g., for Microsoft Go). Defaults to "https://go.dev/dl". Can also be set via the GO_DOWNLOAD_BASE_URL environment variable. The input takes precedence over the environment variable.' + description: 'Custom base URL for downloading Go distributions. Use this to download Go from a mirror or custom source. Defaults to "https://go.dev/dl". Can also be set via the GO_DOWNLOAD_BASE_URL environment variable. The input takes precedence over the environment variable.' outputs: go-version: description: 'The installed Go version. Useful when given a version range as input.' diff --git a/src/installer.ts b/src/installer.ts index 9fc1953..d8fbe62 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -157,13 +157,7 @@ export async function getGo( // Try download from internal distribution (popular versions only) // try { - info = await getInfoFromManifest( - versionSpec, - true, - auth, - arch, - manifest - ); + info = await getInfoFromManifest(versionSpec, true, auth, arch, manifest); if (info) { downloadPath = await installGoVersion(info, auth, arch); } else { @@ -485,9 +479,7 @@ export function getInfoFromDirectDownload( const fileName = `${goVersion}.${platStr}-${archStr}.${extension}`; const downloadUrl = `${goDownloadBaseUrl}/${fileName}`; - core.info( - `Constructed direct download URL: ${downloadUrl}` - ); + core.info(`Constructed direct download URL: ${downloadUrl}`); return { type: 'dist',