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 authored and GitHub committed 2026-11-02 12:49:42 -06:00
1 parent 90ad2b35f6
commit 3c1b57c66a
7 files changed
+208 -9

No files matched your search

+12
View File
@@ -215,6 +215,18 @@ function resolveVersionInput(): string {
}
if (version) {
const customBaseUrl =
core.getInput('go-download-base-url') ||
process.env['GO_DOWNLOAD_BASE_URL'];
if (
version.startsWith('go') &&
!customBaseUrl &&
!installer.isGoNativeVersion(version)
) {
throw new Error(
`Invalid Go version "${version}". Go-native versions must look like go1.21, go1.21.5, go1.18beta2, or go1.21rc2. For version ranges, use SemVer syntax (e.g. ~1.21, ^1.21).`
);
}
return version;
}