Commit graph setup-go/docs/advanced-usage.md
Author SHA1 Message Date
John Maguire
f75efb3f19 Resolve latest-patch from the versions manifest and tighten input handling
- latest-patch implies check-latest so the newest patch release comes
  from the versions manifest instead of a possibly stale runner tool
  cache, with a warning when the manifest cannot be reached
- fail fast when latest-patch is combined with a custom download base URL
- never widen an exact toolchain directive pin
- validate go-version-file-behavior on every input path
- widen v-prefixed versions and log when a version is used as written
- document dependency cache invalidation on new patch releases
2026-08-18 13:28:12 -04:00
John Maguire
71b6f8926f Add go-version-file-behavior input
By default an exact version read from go-version-file is used as
written, so a "go 1.22.0" directive pins CI to the oldest patch
release of the minor even when newer patches with security fixes
exist. Dependencies can force such an exact version into go.mod.

Setting go-version-file-behavior to latest-patch widens an exact
major.minor.patch version into a ~X.Y.Z range, resolving the newest
available patch release of the same minor while keeping the file's
version as a floor. Bare minors and prereleases pass through
unchanged. The default behavior (exact) is unchanged.
2026-08-18 11:52:47 -04:00
Haritha
5064d95ba1
Upgrade checkout refs and docs to v7 (#779)
* chore: upgrade checkout/setup-go refs to v7

* chore: commit remaining dependency, license, and dist updates
2026-07-27 15:26:25 -05:00
George Adams
4a3601121d
docs: fix Microsoft build of Go link (#734) 2026-03-17 14:02:21 -05:00
George Adams
8f19afcc70
feat: add go-download-base-url input for custom Go distributions (#721)
* 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
2026-03-16 12:43:44 -05:00
Priya Gupta
def8c394e3
Rearrange README.md, add advanced-usage.md (#724)
* Rearrange README.md, add advanced-usage.md

* Fix YAML indentation in examples

* Fix YAML indentation in Advanced Usage workflow examples
2026-02-26 12:35:02 -06:00