Skip to content

Commit bf1ba78

Browse files
committed
Sort function order
1 parent 7c003c1 commit bf1ba78

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psm1

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,26 @@ function Format-GHActionsEscapeCharacters {
2828
}
2929
<#
3030
.SYNOPSIS
31+
GitHub Actions - Internal - Test Environment Variable
32+
.DESCRIPTION
33+
An internal function to validate environment variable.
34+
.PARAMETER InputObject
35+
Environment variable that need to validate.
36+
.OUTPUTS
37+
Boolean -or Void
38+
#>
39+
function Test-GHActionsEnvironmentVariable {
40+
[CmdletBinding()]
41+
param (
42+
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)][string]$InputObject
43+
)
44+
if (($InputObject -match '^[\da-z_]+=.+$') -and (($InputObject -split '=').Count -eq 2)) {
45+
return $true
46+
}
47+
Write-Error -Message "Input `"$InputObject`" is not match the require environment variable pattern." -Category SyntaxError
48+
}
49+
<#
50+
.SYNOPSIS
3151
GitHub Actions - Internal - Write Workflow Command
3252
.DESCRIPTION
3353
An internal function to write workflow command.
@@ -58,26 +78,6 @@ function Write-GHActionsCommand {
5878
}
5979
<#
6080
.SYNOPSIS
61-
GitHub Actions - Internal - Test Environment Variable
62-
.DESCRIPTION
63-
An internal function to validate environment variable.
64-
.PARAMETER InputObject
65-
Environment variable that need to validate.
66-
.OUTPUTS
67-
Boolean -or Void
68-
#>
69-
function Test-GHActionsEnvironmentVariable {
70-
[CmdletBinding()]
71-
param (
72-
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)][string]$InputObject
73-
)
74-
if (($InputObject -match '^[\da-z_]+=.+$') -and (($InputObject -split '=').Count -eq 2)) {
75-
return $true
76-
}
77-
Write-Error -Message "Input `"$InputObject`" is not match the require environment variable pattern." -Category SyntaxError
78-
}
79-
<#
80-
.SYNOPSIS
8181
GitHub Actions - Add Environment Variable
8282
.DESCRIPTION
8383
Add environment variable to the system environment variables and automatically makes it available to all subsequent actions in the current job; The currently running action cannot access the updated environment variables.

0 commit comments

Comments
 (0)