Skip to content

Commit 4977e1c

Browse files
committed
Validate exit code
1 parent 7b6c3ef commit 4977e1c

File tree

1 file changed

+1
-1
lines changed
  • hugoalh.GitHubActionsToolkit/module

1 file changed

+1
-1
lines changed

hugoalh.GitHubActionsToolkit/module/log.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Function Write-Fail {
232232
[AllowEmptyString()][AllowNull()][ValidatePattern('^.*$', ErrorMessage = 'Value is not a single line string!')][Alias('Header')][String]$Title,
233233
[Parameter(ValueFromPipelineByPropertyName = $True)][AllowEmptyString()][AllowNull()][String]$Summary,
234234
[ScriptBlock]$Finally = {},
235-
[Int16]$ExitCode = 1
235+
[ValidateScript({ $_ -ine 0 }, ErrorMessage = 'Value is not a valid non-success exit code!')][Int16]$ExitCode = 1
236236
)
237237
Write-Annotation -Type 'error' -Message $Message -File $File -Line $Line -Column $Column -EndLine $EndLine -EndColumn $EndColumn -Title $Title -Summary $Summary
238238
Invoke-Command -ScriptBlock $Finally -ErrorAction 'Continue'

0 commit comments

Comments
 (0)