mirror of
https://github.com/actions/setup-go.git
synced 2026-03-17 02:24:58 +00:00
feat: add go-download-base-url input for custom Go distributions (#721)
Some checks failed
Validate Microsoft build of Go / Microsoft build of Go 1.24 on macos-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go 1.24 on windows-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go 1.25 on macos-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go 1.25 on windows-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go via env var on macos-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go via env var on windows-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go arch arm64 on macos-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go arch x64 on macos-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go with caching on macos-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go with caching on windows-latest (push) Waiting to run
Validate 'setup-go' / stable (macos-latest) (push) Waiting to run
Validate 'setup-go' / stable (macos-latest-large) (push) Waiting to run
Validate 'setup-go' / stable (windows-latest) (push) Waiting to run
Validate 'setup-go' / oldstable (macos-latest) (push) Waiting to run
Validate 'setup-go' / oldstable (macos-latest-large) (push) Waiting to run
Validate 'setup-go' / oldstable (windows-latest) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x32, windows-latest, oldstable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x32, windows-latest, stable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x64, macos-latest, oldstable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x64, macos-latest, stable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x64, macos-latest-large, oldstable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x64, macos-latest-large, stable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x64, windows-latest, oldstable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x64, windows-latest, stable) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.20.14, windows-latest) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.21.13, macos-latest) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.21.13, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.21.13, windows-latest) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.22.8, macos-latest) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.22.8, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.22.8, windows-latest) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.23.2, macos-latest) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.23.2, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / check-latest (1.20, macos-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.20, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / check-latest (1.20, windows-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.21, macos-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.21, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / check-latest (1.21, windows-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.22, macos-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.22, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / check-latest (1.22, windows-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.23, macos-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.23, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / check-latest (1.23, windows-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file (macos-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file (macos-latest-large) (push) Waiting to run
Validate 'setup-go' / go-version-file (windows-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-gowork (macos-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-gowork (macos-latest-large) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-gowork (windows-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-tool-versions (macos-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-tool-versions (macos-latest-large) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-tool-versions (windows-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-go-version (macos-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-go-version (macos-latest-large) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-go-version (windows-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, macos-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, windows-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, windows-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, windows-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, windows-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-dist (1.11.12, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-dist (1.11.12, windows-latest) (push) Waiting to run
Validate 'setup-go' / architecture (arm64, 1.20.14, macos-latest) (push) Waiting to run
Validate 'setup-go' / architecture (arm64, 1.21, macos-latest) (push) Waiting to run
Validate 'setup-go' / architecture (arm64, 1.22, macos-latest) (push) Waiting to run
Validate 'setup-go' / architecture (arm64, 1.23, macos-latest) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.20.14, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.20.14, windows-latest) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.21, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.21, windows-latest) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.22, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.22, windows-latest) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.23, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.23, windows-latest) (push) Waiting to run
Validate Windows installation / Validate if symlink is created (false, 1.20.1) (push) Waiting to run
Validate Windows installation / Validate if symlink is created (true, 1.20.1) (push) Waiting to run
Validate Windows installation / Find default go version (push) Waiting to run
Validate Windows installation / Validate if symlink is not created for default go (false) (push) Blocked by required conditions
Validate Windows installation / Validate if symlink is not created for default go (true) (push) Blocked by required conditions
Validate Windows installation / Validate if hostedtoolcache works as expected (false, 1.20.1) (push) Waiting to run
Basic validation / Basic validation (push) Failing after 37s
Validate Microsoft build of Go / Microsoft build of Go 1.24 on ubuntu-latest (push) Failing after 39s
Validate Microsoft build of Go / Microsoft build of Go 1.25 on ubuntu-latest (push) Failing after 40s
Validate Microsoft build of Go / Microsoft build of Go via env var on ubuntu-latest (push) Failing after 40s
Validate Microsoft build of Go / Microsoft build of Go arch x64 on ubuntu-latest (push) Failing after 40s
Validate Microsoft build of Go / Microsoft build of Go with caching on ubuntu-latest (push) Failing after 40s
Check dist/ / Check dist/ (push) Failing after 1m20s
CodeQL analysis / CodeQL analysis (push) Failing after 1m20s
Licensed / Licensed (push) Failing after 1m19s
Validate 'setup-go' / stable (ubuntu-latest) (push) Failing after 4s
Validate 'setup-go' / oldstable (ubuntu-latest) (push) Failing after 4s
Validate 'setup-go' / aliases-arch (x32, ubuntu-latest, oldstable) (push) Failing after 5s
Validate 'setup-go' / aliases-arch (x32, ubuntu-latest, stable) (push) Failing after 6s
Validate 'setup-go' / aliases-arch (x64, ubuntu-latest, oldstable) (push) Failing after 6s
Validate 'setup-go' / aliases-arch (x64, ubuntu-latest, stable) (push) Failing after 7s
Validate 'setup-go' / Setup local-cache version (1.21.13, ubuntu-latest) (push) Failing after 7s
Validate 'setup-go' / Setup local-cache version (1.22.8, ubuntu-latest) (push) Failing after 6s
Validate 'setup-go' / Setup local-cache version (1.23.2, ubuntu-latest) (push) Failing after 8s
Validate 'setup-go' / check-latest (1.20, ubuntu-latest) (push) Failing after 8s
Validate 'setup-go' / check-latest (1.21, ubuntu-latest) (push) Failing after 8s
Validate 'setup-go' / check-latest (1.22, ubuntu-latest) (push) Failing after 8s
Validate 'setup-go' / check-latest (1.23, ubuntu-latest) (push) Failing after 8s
Validate 'setup-go' / go-version-file (ubuntu-latest) (push) Failing after 8s
Validate 'setup-go' / go-version-file-with-gowork (ubuntu-latest) (push) Failing after 9s
Validate 'setup-go' / go-version-file-with-tool-versions (ubuntu-latest) (push) Failing after 9s
Validate 'setup-go' / go-version-file-with-go-version (ubuntu-latest) (push) Failing after 16s
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, ubuntu-latest) (push) Failing after 17s
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, ubuntu-latest) (push) Failing after 19s
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, ubuntu-latest) (push) Failing after 21s
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, ubuntu-latest) (push) Failing after 22s
Validate 'setup-go' / setup-versions-from-dist (1.11.12, ubuntu-latest) (push) Failing after 24s
Validate 'setup-go' / architecture (x64, 1.20.14, ubuntu-latest) (push) Failing after 25s
Validate 'setup-go' / architecture (x64, 1.21, ubuntu-latest) (push) Failing after 25s
Validate 'setup-go' / architecture (x64, 1.22, ubuntu-latest) (push) Failing after 29s
Validate 'setup-go' / architecture (x64, 1.23, ubuntu-latest) (push) Failing after 28s
Some checks failed
Validate Microsoft build of Go / Microsoft build of Go 1.24 on macos-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go 1.24 on windows-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go 1.25 on macos-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go 1.25 on windows-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go via env var on macos-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go via env var on windows-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go arch arm64 on macos-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go arch x64 on macos-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go with caching on macos-latest (push) Waiting to run
Validate Microsoft build of Go / Microsoft build of Go with caching on windows-latest (push) Waiting to run
Validate 'setup-go' / stable (macos-latest) (push) Waiting to run
Validate 'setup-go' / stable (macos-latest-large) (push) Waiting to run
Validate 'setup-go' / stable (windows-latest) (push) Waiting to run
Validate 'setup-go' / oldstable (macos-latest) (push) Waiting to run
Validate 'setup-go' / oldstable (macos-latest-large) (push) Waiting to run
Validate 'setup-go' / oldstable (windows-latest) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x32, windows-latest, oldstable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x32, windows-latest, stable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x64, macos-latest, oldstable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x64, macos-latest, stable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x64, macos-latest-large, oldstable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x64, macos-latest-large, stable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x64, windows-latest, oldstable) (push) Waiting to run
Validate 'setup-go' / aliases-arch (x64, windows-latest, stable) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.20.14, windows-latest) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.21.13, macos-latest) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.21.13, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.21.13, windows-latest) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.22.8, macos-latest) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.22.8, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.22.8, windows-latest) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.23.2, macos-latest) (push) Waiting to run
Validate 'setup-go' / Setup local-cache version (1.23.2, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / check-latest (1.20, macos-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.20, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / check-latest (1.20, windows-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.21, macos-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.21, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / check-latest (1.21, windows-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.22, macos-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.22, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / check-latest (1.22, windows-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.23, macos-latest) (push) Waiting to run
Validate 'setup-go' / check-latest (1.23, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / check-latest (1.23, windows-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file (macos-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file (macos-latest-large) (push) Waiting to run
Validate 'setup-go' / go-version-file (windows-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-gowork (macos-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-gowork (macos-latest-large) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-gowork (windows-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-tool-versions (macos-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-tool-versions (macos-latest-large) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-tool-versions (windows-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-go-version (macos-latest) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-go-version (macos-latest-large) (push) Waiting to run
Validate 'setup-go' / go-version-file-with-go-version (windows-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, macos-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, windows-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, windows-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, windows-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, windows-latest) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-dist (1.11.12, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / setup-versions-from-dist (1.11.12, windows-latest) (push) Waiting to run
Validate 'setup-go' / architecture (arm64, 1.20.14, macos-latest) (push) Waiting to run
Validate 'setup-go' / architecture (arm64, 1.21, macos-latest) (push) Waiting to run
Validate 'setup-go' / architecture (arm64, 1.22, macos-latest) (push) Waiting to run
Validate 'setup-go' / architecture (arm64, 1.23, macos-latest) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.20.14, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.20.14, windows-latest) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.21, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.21, windows-latest) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.22, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.22, windows-latest) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.23, macos-latest-large) (push) Waiting to run
Validate 'setup-go' / architecture (x64, 1.23, windows-latest) (push) Waiting to run
Validate Windows installation / Validate if symlink is created (false, 1.20.1) (push) Waiting to run
Validate Windows installation / Validate if symlink is created (true, 1.20.1) (push) Waiting to run
Validate Windows installation / Find default go version (push) Waiting to run
Validate Windows installation / Validate if symlink is not created for default go (false) (push) Blocked by required conditions
Validate Windows installation / Validate if symlink is not created for default go (true) (push) Blocked by required conditions
Validate Windows installation / Validate if hostedtoolcache works as expected (false, 1.20.1) (push) Waiting to run
Basic validation / Basic validation (push) Failing after 37s
Validate Microsoft build of Go / Microsoft build of Go 1.24 on ubuntu-latest (push) Failing after 39s
Validate Microsoft build of Go / Microsoft build of Go 1.25 on ubuntu-latest (push) Failing after 40s
Validate Microsoft build of Go / Microsoft build of Go via env var on ubuntu-latest (push) Failing after 40s
Validate Microsoft build of Go / Microsoft build of Go arch x64 on ubuntu-latest (push) Failing after 40s
Validate Microsoft build of Go / Microsoft build of Go with caching on ubuntu-latest (push) Failing after 40s
Check dist/ / Check dist/ (push) Failing after 1m20s
CodeQL analysis / CodeQL analysis (push) Failing after 1m20s
Licensed / Licensed (push) Failing after 1m19s
Validate 'setup-go' / stable (ubuntu-latest) (push) Failing after 4s
Validate 'setup-go' / oldstable (ubuntu-latest) (push) Failing after 4s
Validate 'setup-go' / aliases-arch (x32, ubuntu-latest, oldstable) (push) Failing after 5s
Validate 'setup-go' / aliases-arch (x32, ubuntu-latest, stable) (push) Failing after 6s
Validate 'setup-go' / aliases-arch (x64, ubuntu-latest, oldstable) (push) Failing after 6s
Validate 'setup-go' / aliases-arch (x64, ubuntu-latest, stable) (push) Failing after 7s
Validate 'setup-go' / Setup local-cache version (1.21.13, ubuntu-latest) (push) Failing after 7s
Validate 'setup-go' / Setup local-cache version (1.22.8, ubuntu-latest) (push) Failing after 6s
Validate 'setup-go' / Setup local-cache version (1.23.2, ubuntu-latest) (push) Failing after 8s
Validate 'setup-go' / check-latest (1.20, ubuntu-latest) (push) Failing after 8s
Validate 'setup-go' / check-latest (1.21, ubuntu-latest) (push) Failing after 8s
Validate 'setup-go' / check-latest (1.22, ubuntu-latest) (push) Failing after 8s
Validate 'setup-go' / check-latest (1.23, ubuntu-latest) (push) Failing after 8s
Validate 'setup-go' / go-version-file (ubuntu-latest) (push) Failing after 8s
Validate 'setup-go' / go-version-file-with-gowork (ubuntu-latest) (push) Failing after 9s
Validate 'setup-go' / go-version-file-with-tool-versions (ubuntu-latest) (push) Failing after 9s
Validate 'setup-go' / go-version-file-with-go-version (ubuntu-latest) (push) Failing after 16s
Validate 'setup-go' / setup-versions-from-manifest (1.20.14, ubuntu-latest) (push) Failing after 17s
Validate 'setup-go' / setup-versions-from-manifest (1.21.10, ubuntu-latest) (push) Failing after 19s
Validate 'setup-go' / setup-versions-from-manifest (1.22.8, ubuntu-latest) (push) Failing after 21s
Validate 'setup-go' / setup-versions-from-manifest (1.23.2, ubuntu-latest) (push) Failing after 22s
Validate 'setup-go' / setup-versions-from-dist (1.11.12, ubuntu-latest) (push) Failing after 24s
Validate 'setup-go' / architecture (x64, 1.20.14, ubuntu-latest) (push) Failing after 25s
Validate 'setup-go' / architecture (x64, 1.21, ubuntu-latest) (push) Failing after 25s
Validate 'setup-go' / architecture (x64, 1.22, ubuntu-latest) (push) Failing after 29s
Validate 'setup-go' / architecture (x64, 1.23, ubuntu-latest) (push) Failing after 28s
* feat: add go-download-base-url input for custom Go distributions
Add support for downloading Go from custom sources such as Microsoft Go
(aka.ms). Users can specify a custom download base URL via the
`go-download-base-url` input or the `GO_DOWNLOAD_BASE_URL` environment
variable (input takes precedence).
When a custom URL is provided, the action skips the GitHub-hosted
manifest and attempts to resolve versions from the custom URL's JSON
listing. If the listing is unavailable (as with aka.ms redirect links),
it falls back to constructing the download URL directly from the
version, platform, and architecture.
Usage:
- uses: actions/setup-go@v6
with:
go-version: '1.25'
go-download-base-url: 'https://aka.ms/golang/release/latest'
Changes:
- action.yml: add go-download-base-url optional input
- installer.ts: add getInfoFromDirectDownload() for URL construction
fallback, thread custom URL through getGo/getInfoFromDist/findMatch
- main.ts: read new input and GO_DOWNLOAD_BASE_URL env var
- setup-go.test.ts: add 12 unit tests for custom URL behavior
- microsoft-validation.yml: add E2E workflow testing Microsoft build of Go
across ubuntu/windows/macos with versions 1.24 and 1.25
- README.md: document new input with Microsoft build of Go examples
* run prettier
* fixup PR review
* revert cache-save
* fixup
* handle distinct cache
* skip json for known URL
* fix bug in JSON with custom URL
This commit is contained in:
@@ -45,6 +45,7 @@ describe('setup-go', () => {
|
||||
let mkdirSpy: jest.SpyInstance;
|
||||
let symlinkSpy: jest.SpyInstance;
|
||||
let execSpy: jest.SpyInstance;
|
||||
let execFileSpy: jest.SpyInstance;
|
||||
let getManifestSpy: jest.SpyInstance;
|
||||
let getAllVersionsSpy: jest.SpyInstance;
|
||||
let httpmGetJsonSpy: jest.SpyInstance;
|
||||
@@ -71,6 +72,10 @@ describe('setup-go', () => {
|
||||
archSpy = jest.spyOn(osm, 'arch');
|
||||
archSpy.mockImplementation(() => os['arch']);
|
||||
execSpy = jest.spyOn(cp, 'execSync');
|
||||
execFileSpy = jest.spyOn(cp, 'execFileSync');
|
||||
execFileSpy.mockImplementation(() => {
|
||||
throw new Error('ENOENT');
|
||||
});
|
||||
|
||||
// switch path join behaviour based on set os.platform
|
||||
joinSpy = jest.spyOn(path, 'join');
|
||||
@@ -129,8 +134,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();
|
||||
@@ -1105,4 +1111,456 @@ use .
|
||||
expect(vars).toStrictEqual({GOTOOLCHAIN: 'local'});
|
||||
expect(process.env).toHaveProperty('GOTOOLCHAIN', 'local');
|
||||
});
|
||||
|
||||
describe('go-download-base-url', () => {
|
||||
it('downloads a version from custom base URL using version listing', async () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
const versionSpec = '1.13.1';
|
||||
const customBaseUrl = 'https://example.com/golang';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
inputs['go-download-base-url'] = customBaseUrl;
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
dlSpy.mockImplementation(async () => '/some/temp/path');
|
||||
const toolPath = path.normalize('/cache/go/1.13.1/x64');
|
||||
extractTarSpy.mockImplementation(async () => '/some/other/temp/path');
|
||||
cacheSpy.mockImplementation(async () => toolPath);
|
||||
|
||||
await main.run();
|
||||
|
||||
const expPath = path.join(toolPath, 'bin');
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
`Using custom Go download base URL: ${customBaseUrl}`
|
||||
);
|
||||
expect(logSpy).toHaveBeenCalledWith('Install from custom download URL');
|
||||
// Version listing should use custom base URL, not go.dev
|
||||
expect(getSpy).toHaveBeenCalledWith(
|
||||
`${customBaseUrl}/?mode=json&include=all`
|
||||
);
|
||||
expect(dlSpy).toHaveBeenCalled();
|
||||
expect(extractTarSpy).toHaveBeenCalled();
|
||||
expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${osm.EOL}`);
|
||||
});
|
||||
|
||||
it('skips version listing for known direct-download URL (aka.ms)', async () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
const versionSpec = '1.25.0';
|
||||
const customBaseUrl = 'https://aka.ms/golang/release/latest';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
inputs['go-download-base-url'] = customBaseUrl;
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
dlSpy.mockImplementation(async () => '/some/temp/path');
|
||||
const toolPath = path.normalize('/cache/go/1.25.0/x64');
|
||||
extractTarSpy.mockImplementation(async () => '/some/other/temp/path');
|
||||
cacheSpy.mockImplementation(async () => toolPath);
|
||||
|
||||
await main.run();
|
||||
|
||||
const expPath = path.join(toolPath, 'bin');
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
'Skipping version listing for known direct-download URL. Constructing download URL directly.'
|
||||
);
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
`Constructed direct download URL: ${customBaseUrl}/go1.25.0.linux-amd64.tar.gz`
|
||||
);
|
||||
expect(logSpy).toHaveBeenCalledWith('Install from custom download URL');
|
||||
expect(getSpy).not.toHaveBeenCalled();
|
||||
expect(dlSpy).toHaveBeenCalled();
|
||||
expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${osm.EOL}`);
|
||||
});
|
||||
|
||||
it('constructs correct direct download URL for windows (aka.ms)', async () => {
|
||||
os.platform = 'win32';
|
||||
os.arch = 'x64';
|
||||
|
||||
const versionSpec = '1.25.0';
|
||||
const customBaseUrl = 'https://aka.ms/golang/release/latest';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
inputs['go-download-base-url'] = customBaseUrl;
|
||||
process.env['RUNNER_TEMP'] = 'C:\\temp\\';
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
dlSpy.mockImplementation(async () => 'C:\\temp\\some\\path');
|
||||
extractZipSpy.mockImplementation(() => 'C:\\temp\\some\\other\\path');
|
||||
const toolPath = path.normalize('C:\\cache\\go\\1.25.0\\x64');
|
||||
cacheSpy.mockImplementation(async () => toolPath);
|
||||
|
||||
await main.run();
|
||||
|
||||
expect(getSpy).not.toHaveBeenCalled();
|
||||
expect(dlSpy).toHaveBeenCalledWith(
|
||||
`${customBaseUrl}/go1.25.0.windows-amd64.zip`,
|
||||
'C:\\temp\\go1.25.0.windows-amd64.zip',
|
||||
undefined
|
||||
);
|
||||
});
|
||||
|
||||
it('skips manifest and downloads directly from custom URL', async () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
const versionSpec = '1.12.16';
|
||||
const customBaseUrl = 'https://example.com/golang';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
inputs['go-download-base-url'] = customBaseUrl;
|
||||
inputs['token'] = 'faketoken';
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
dlSpy.mockImplementation(async () => '/some/temp/path');
|
||||
const toolPath = path.normalize('/cache/go/1.12.16/x64');
|
||||
extractTarSpy.mockImplementation(async () => '/some/other/temp/path');
|
||||
cacheSpy.mockImplementation(async () => toolPath);
|
||||
|
||||
await main.run();
|
||||
|
||||
// Should not try to use the manifest at all
|
||||
expect(logSpy).not.toHaveBeenCalledWith(
|
||||
expect.stringContaining('Not found in manifest')
|
||||
);
|
||||
expect(logSpy).toHaveBeenCalledWith('Install from custom download URL');
|
||||
});
|
||||
|
||||
it('strips trailing slashes from custom base URL', async () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
const versionSpec = '1.13.1';
|
||||
const customBaseUrl = 'https://example.com/golang/';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
inputs['go-download-base-url'] = customBaseUrl;
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
dlSpy.mockImplementation(async () => '/some/temp/path');
|
||||
const toolPath = path.normalize('/cache/go/1.13.1/x64');
|
||||
extractTarSpy.mockImplementation(async () => '/some/other/temp/path');
|
||||
cacheSpy.mockImplementation(async () => toolPath);
|
||||
|
||||
await main.run();
|
||||
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
`Acquiring go1.13.1 from https://example.com/golang/go1.13.1.linux-amd64.tar.gz`
|
||||
);
|
||||
});
|
||||
|
||||
it('reads custom base URL from environment variable', async () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
const versionSpec = '1.13.1';
|
||||
const customBaseUrl = 'https://example.com/golang';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
process.env['GO_DOWNLOAD_BASE_URL'] = customBaseUrl;
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
dlSpy.mockImplementation(async () => '/some/temp/path');
|
||||
const toolPath = path.normalize('/cache/go/1.13.1/x64');
|
||||
extractTarSpy.mockImplementation(async () => '/some/other/temp/path');
|
||||
cacheSpy.mockImplementation(async () => toolPath);
|
||||
|
||||
await main.run();
|
||||
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
`Using custom Go download base URL: ${customBaseUrl}`
|
||||
);
|
||||
expect(logSpy).toHaveBeenCalledWith('Install from custom download URL');
|
||||
});
|
||||
|
||||
it('input takes precedence over environment variable', async () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
const versionSpec = '1.13.1';
|
||||
const inputUrl = 'https://input.example.com/golang';
|
||||
const envUrl = 'https://env.example.com/golang';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
inputs['go-download-base-url'] = inputUrl;
|
||||
process.env['GO_DOWNLOAD_BASE_URL'] = envUrl;
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
dlSpy.mockImplementation(async () => '/some/temp/path');
|
||||
const toolPath = path.normalize('/cache/go/1.13.1/x64');
|
||||
extractTarSpy.mockImplementation(async () => '/some/other/temp/path');
|
||||
cacheSpy.mockImplementation(async () => toolPath);
|
||||
|
||||
await main.run();
|
||||
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
`Using custom Go download base URL: ${inputUrl}`
|
||||
);
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
`Acquiring go1.13.1 from ${inputUrl}/go1.13.1.linux-amd64.tar.gz`
|
||||
);
|
||||
});
|
||||
|
||||
it('errors when stable alias is used with custom URL', async () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
inputs['go-version'] = 'stable';
|
||||
inputs['go-download-base-url'] = 'https://example.com/golang';
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
await main.run();
|
||||
|
||||
expect(cnSpy).toHaveBeenCalledWith(
|
||||
`::error::Version aliases 'stable' are not supported with a custom download base URL. Please specify an exact Go version.${osm.EOL}`
|
||||
);
|
||||
});
|
||||
|
||||
it('logs info when check-latest is used with custom URL', async () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
const versionSpec = '1.13.1';
|
||||
const customBaseUrl = 'https://example.com/golang';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
inputs['go-download-base-url'] = customBaseUrl;
|
||||
inputs['check-latest'] = true;
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
dlSpy.mockImplementation(async () => '/some/temp/path');
|
||||
const toolPath = path.normalize('/cache/go/1.13.1/x64');
|
||||
extractTarSpy.mockImplementation(async () => '/some/other/temp/path');
|
||||
cacheSpy.mockImplementation(async () => toolPath);
|
||||
|
||||
await main.run();
|
||||
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
'check-latest is not supported with a custom download base URL. Using the provided version spec directly.'
|
||||
);
|
||||
});
|
||||
|
||||
it('constructs direct download info correctly', () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
const info = im.getInfoFromDirectDownload(
|
||||
'1.25.0',
|
||||
'x64',
|
||||
'https://aka.ms/golang/release/latest'
|
||||
);
|
||||
|
||||
expect(info.type).toBe('dist');
|
||||
expect(info.downloadUrl).toBe(
|
||||
'https://aka.ms/golang/release/latest/go1.25.0.linux-amd64.tar.gz'
|
||||
);
|
||||
expect(info.fileName).toBe('go1.25.0.linux-amd64.tar.gz');
|
||||
expect(info.resolvedVersion).toBe('1.25.0');
|
||||
});
|
||||
|
||||
it('constructs direct download info for windows', () => {
|
||||
os.platform = 'win32';
|
||||
os.arch = 'x64';
|
||||
|
||||
const info = im.getInfoFromDirectDownload(
|
||||
'1.25.0',
|
||||
'x64',
|
||||
'https://aka.ms/golang/release/latest'
|
||||
);
|
||||
|
||||
expect(info.type).toBe('dist');
|
||||
expect(info.downloadUrl).toBe(
|
||||
'https://aka.ms/golang/release/latest/go1.25.0.windows-amd64.zip'
|
||||
);
|
||||
expect(info.fileName).toBe('go1.25.0.windows-amd64.zip');
|
||||
});
|
||||
|
||||
it('constructs direct download info for arm64', () => {
|
||||
os.platform = 'darwin';
|
||||
os.arch = 'arm64';
|
||||
|
||||
const info = im.getInfoFromDirectDownload(
|
||||
'1.25.0',
|
||||
'arm64',
|
||||
'https://aka.ms/golang/release/latest'
|
||||
);
|
||||
|
||||
expect(info.type).toBe('dist');
|
||||
expect(info.downloadUrl).toBe(
|
||||
'https://aka.ms/golang/release/latest/go1.25.0.darwin-arm64.tar.gz'
|
||||
);
|
||||
expect(info.fileName).toBe('go1.25.0.darwin-arm64.tar.gz');
|
||||
});
|
||||
|
||||
it('caches under actual installed version when it differs from input spec', async () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
const versionSpec = '1.20';
|
||||
const customBaseUrl = 'https://aka.ms/golang/release/latest';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
inputs['go-download-base-url'] = customBaseUrl;
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
dlSpy.mockImplementation(async () => '/some/temp/path');
|
||||
extractTarSpy.mockImplementation(async () => '/some/other/temp/path');
|
||||
|
||||
// Mock the installed Go binary reporting a different patch version
|
||||
execFileSpy.mockImplementation(() => 'go version go1.20.14 linux/amd64');
|
||||
|
||||
const expectedToolName = im.customToolCacheName(customBaseUrl);
|
||||
const toolPath = path.normalize(`/cache/${expectedToolName}/1.20.14/x64`);
|
||||
cacheSpy.mockImplementation(async () => toolPath);
|
||||
|
||||
await main.run();
|
||||
|
||||
expect(logSpy).toHaveBeenCalledWith(
|
||||
"Requested version '1.20' resolved to installed version '1.20.14'"
|
||||
);
|
||||
// Cache key should use actual version, not the input spec
|
||||
expect(cacheSpy).toHaveBeenCalledWith(
|
||||
expect.any(String),
|
||||
expectedToolName,
|
||||
'1.20.14',
|
||||
'x64'
|
||||
);
|
||||
});
|
||||
|
||||
it('shows clear error with platform/arch and URL on 404', async () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'arm64';
|
||||
|
||||
const versionSpec = '1.25.0';
|
||||
const customBaseUrl = 'https://example.com/golang';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
inputs['go-download-base-url'] = customBaseUrl;
|
||||
|
||||
getSpy.mockImplementationOnce(() => {
|
||||
throw new Error('Not a JSON endpoint');
|
||||
});
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
const httpError = new tc.HTTPError(404);
|
||||
dlSpy.mockImplementation(() => {
|
||||
throw httpError;
|
||||
});
|
||||
|
||||
await main.run();
|
||||
|
||||
expect(cnSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining(
|
||||
'The requested Go version 1.25.0 is not available for platform linux/arm64'
|
||||
)
|
||||
);
|
||||
expect(cnSpy).toHaveBeenCalledWith(expect.stringContaining('HTTP 404'));
|
||||
});
|
||||
|
||||
it('shows clear error with platform/arch and URL on download failure', async () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
const versionSpec = '1.25.0';
|
||||
const customBaseUrl = 'https://example.com/golang';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
inputs['go-download-base-url'] = customBaseUrl;
|
||||
|
||||
getSpy.mockImplementationOnce(() => {
|
||||
throw new Error('Not a JSON endpoint');
|
||||
});
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
dlSpy.mockImplementation(() => {
|
||||
throw new Error('connection refused');
|
||||
});
|
||||
|
||||
await main.run();
|
||||
|
||||
expect(cnSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining(
|
||||
'Failed to download Go 1.25.0 for platform linux/x64'
|
||||
)
|
||||
);
|
||||
expect(cnSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining(customBaseUrl)
|
||||
);
|
||||
});
|
||||
|
||||
it.each(['^1.25.0', '~1.25', '>=1.25.0', '<1.26.0', '1.25.x', '1.x'])(
|
||||
'errors on version range "%s" when version listing is unavailable',
|
||||
async versionSpec => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
inputs['go-download-base-url'] = 'https://example.com/golang';
|
||||
|
||||
// Simulate version listing not available
|
||||
getSpy.mockImplementationOnce(() => {
|
||||
throw new Error('Not a JSON endpoint');
|
||||
});
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
|
||||
await main.run();
|
||||
|
||||
expect(cnSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining(
|
||||
`Version range '${versionSpec}' is not supported with a custom download base URL`
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
it('rejects version range in getInfoFromDirectDownload', () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
expect(() =>
|
||||
im.getInfoFromDirectDownload(
|
||||
'^1.25.0',
|
||||
'x64',
|
||||
'https://example.com/golang'
|
||||
)
|
||||
).toThrow(
|
||||
"Version range '^1.25.0' is not supported with a custom download base URL"
|
||||
);
|
||||
});
|
||||
|
||||
it('passes token as auth header for custom URL downloads', async () => {
|
||||
os.platform = 'linux';
|
||||
os.arch = 'x64';
|
||||
|
||||
const versionSpec = '1.25.0';
|
||||
const customBaseUrl = 'https://private-mirror.example.com/golang';
|
||||
|
||||
inputs['go-version'] = versionSpec;
|
||||
inputs['go-download-base-url'] = customBaseUrl;
|
||||
inputs['token'] = 'ghp_testtoken123';
|
||||
|
||||
getSpy.mockImplementationOnce(() => {
|
||||
throw new Error('Not a JSON endpoint');
|
||||
});
|
||||
|
||||
findSpy.mockImplementation(() => '');
|
||||
dlSpy.mockImplementation(async () => '/some/temp/path');
|
||||
extractTarSpy.mockImplementation(async () => '/some/other/temp/path');
|
||||
const expectedToolName = im.customToolCacheName(customBaseUrl);
|
||||
const toolPath = path.normalize(`/cache/${expectedToolName}/1.25.0/x64`);
|
||||
cacheSpy.mockImplementation(async () => toolPath);
|
||||
|
||||
await main.run();
|
||||
|
||||
expect(dlSpy).toHaveBeenCalledWith(
|
||||
`${customBaseUrl}/go1.25.0.linux-amd64.tar.gz`,
|
||||
undefined,
|
||||
'token ghp_testtoken123'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user