mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 03:57:32 +00:00
report Tool nodes with null or empty versions (#8154)
This commit is contained in:
@@ -161,6 +161,11 @@ class ToolVersionNode: BaseToolNode {
|
||||
[String] $Version
|
||||
|
||||
ToolVersionNode([String] $ToolName, [String] $Version): base($ToolName) {
|
||||
|
||||
if ([String]::IsNullOrEmpty($Version)) {
|
||||
throw "ToolVersionNode '$($this.ToolName)' has empty version"
|
||||
}
|
||||
|
||||
$this.Version = $Version
|
||||
}
|
||||
|
||||
@@ -196,6 +201,11 @@ class ToolVersionsListNode: BaseToolNode {
|
||||
|
||||
ToolVersionsListNode([String] $ToolName, [String[]] $Versions, [String] $MajorVersionRegex, [String] $ListType): base($ToolName) {
|
||||
$this.Versions = $Versions
|
||||
|
||||
if ([String]::IsNullOrEmpty($Versions)) {
|
||||
throw "ToolVersionsListNode '$($this.ToolName)' has empty versions list"
|
||||
}
|
||||
|
||||
$this.MajorVersionRegex = [Regex]::new($MajorVersionRegex)
|
||||
$this.ListType = $ListType
|
||||
$this.ValidateMajorVersionRegex()
|
||||
|
||||
Reference in New Issue
Block a user