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:
1 parent
90ad2b35f6
commit
3c1b57c66a
7 files changed
+208
-9
No files matched your search
+12
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user