mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-25 02:57:18 +08:00
Merge pull request #21 from actions/v-malob/support-go-beta
Support parsing of Go Beta
This commit is contained in:
@@ -15,10 +15,15 @@ class GoVersionsParser: BaseVersionsParser {
|
||||
|
||||
hidden [SemVer] FormatVersion([string]$VersionSpec) {
|
||||
$cleanVersion = $VersionSpec -replace "^go", ""
|
||||
return [SemVer]$cleanVersion
|
||||
$semanticVersion = $cleanVersion -replace "(\d+\.\d+\.?\d+?)((?:alpha|beta|rc))(\d*)",'$1-$2.$3'
|
||||
return [SemVer]$semanticVersion
|
||||
}
|
||||
|
||||
hidden [bool] ShouldIncludeVersion([SemVer]$Version) {
|
||||
if ($Version.PreReleaseLabel) {
|
||||
return $false
|
||||
}
|
||||
|
||||
# For Go, we include all versions greater than 1.12
|
||||
return $Version -gt [SemVer]"1.12.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user