Skip to content

Commit 9fa7f6c

Browse files
committed
Fix enum bug
1 parent da77a86 commit 9fa7f6c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psm1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,12 @@ function Write-GHActionsAnnotation {
553553
[Parameter()][uint]$EndColumn,
554554
[Parameter()][ValidatePattern('^.*$')][Alias('Header')][string]$Title
555555
)
556+
[string]$TypeRaw = ""
557+
switch ($Type.GetHashCode()) {
558+
0 { $TypeRaw = 'notice'; break }
559+
1 { $TypeRaw = 'warning'; break }
560+
2 { $TypeRaw = 'error'; break }
561+
}
556562
[hashtable]$Property = @{}
557563
if ($File.Length -gt 0) {
558564
$Property.'file' = $File
@@ -572,7 +578,7 @@ function Write-GHActionsAnnotation {
572578
if ($Title.Length -gt 0) {
573579
$Property.'title' = $Title
574580
}
575-
Write-GHActionsCommand -Command $Type.ToString().ToLower() -Message $Message -Property $Property
581+
Write-GHActionsCommand -Command $TypeRaw -Message $Message -Property $Property
576582
}
577583
<#
578584
.SYNOPSIS

0 commit comments

Comments
 (0)