Add support for native Go version syntax in go-version input (#804)

* Add support for native Go version syntax in go-version input

* Enhance Go-native version handling and update tests and documentation

* Update docs
This commit is contained in:
v-jitenderpalsingh
2026-11-02 12:49:42 -06:00
committed by GitHub
parent 90ad2b35f6
commit 3c1b57c66a
7 changed files with 208 additions and 9 deletions
+6
View File
@@ -50,9 +50,13 @@ steps:
- The preinstalled patch version is generally the latest available. When a new patch is released, it replaces the previously preinstalled version on the runner.
- Using the most recent patch version speeds up setup because the required Go version is already installed on the runner and no download is needed.
The `go-version` input also accepts native Go version strings: `go1.21.5`, `go1.18beta2`, and `go1.21rc2` normalize to `1.21.5`, `1.18.0-beta.2`, and `1.21.0-rc.2`, respectively. `go1.21` resolves to exactly `1.21.0`; use `1.21` for matching patch releases. For ranges and wildcards, use SemVer syntax such as `~1.21` or `1.21.x`, not `go1.21.x`.
To try a **pre-release**:
Download and use beta or RC Go versions as needed.
The `go-version` input also accepts native Go version strings: `go1.21.5`, `go1.18beta2`, and `go1.21rc2` normalize to `1.21.5`, `1.18.0-beta.2`, and `1.21.0-rc.2`, respectively. `go1.21` resolves to exactly `1.21.0`; use `1.21` for matching patch releases. For ranges and wildcards, use SemVer syntax such as `~1.21` or `1.21.x`, not `go1.21.x`.
```yaml
# RC version
steps:
@@ -459,6 +463,8 @@ The `go-download-base-url` input lets you download Go from a mirror or alternati
When a custom base URL is provided, the action skips the `actions/go-versions` manifest lookup and downloads directly from the specified URL.
> **Note:** When constructing direct-download filenames, the original version string is preserved; native Go version normalization is used only for matching and tool cache lookups.
**Using the [Microsoft build of Go](https://github.com/microsoft/go):**
```yaml