mirror of
https://github.com/actions/setup-go.git
synced 2026-03-14 14:45:45 +01:00
run prettier
This commit is contained in:
parent
78af96c188
commit
107f2fc644
5 changed files with 9 additions and 23 deletions
9
.github/workflows/microsoft-validation.yml
vendored
9
.github/workflows/microsoft-validation.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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: ''
|
||||
```
|
||||
<!-- end usage -->
|
||||
|
|
|
|||
|
|
@ -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 () => {
|
||||
|
|
|
|||
|
|
@ -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.'
|
||||
|
|
|
|||
|
|
@ -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 <IGoVersionInfo>{
|
||||
type: 'dist',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue