Skip to content

Commit 76a5bda

Browse files
committed
20220102A
1 parent e7549a3 commit 76a5bda

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psm1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ function Test-GHActionsEnvironmentVariable {
4141
param (
4242
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)][string]$InputObject
4343
)
44-
if (($InputObject -match '^[\da-z_]+=.+$') -and (($InputObject -split '=').Count -eq 2)) {
45-
return $true
44+
begin {}
45+
process {
46+
if (($InputObject -match '^[\da-z_]+=.+$') -and (($InputObject -split '=').Count -eq 2)) {
47+
return $true
48+
}
49+
Write-Error -Message "Input `"$InputObject`" is not match the require environment variable pattern." -Category SyntaxError
4650
}
47-
Write-Error -Message "Input `"$InputObject`" is not match the require environment variable pattern." -Category SyntaxError
51+
end {}
4852
}
4953
<#
5054
.SYNOPSIS

0 commit comments

Comments
 (0)