Skip to content

Commit f49f30c

Browse files
committed
20220920C
1 parent 7c92364 commit f49f30c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

hugoalh.GitHubActionsToolkit/module/nodejs-invoke.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ Function Invoke-NodeJsWrapper {
3939
}
4040
[String]$ResultSeparator = "=====$(New-GitHubActionsRandomToken -Length 32)====="
4141
Try {
42-
[String[]]$Result = node --no-deprecation --no-warnings `"$($WrapperFullName -ireplace '\\', '/')`" `"$(
42+
[String[]]$Result = node --no-deprecation --no-warnings "$($WrapperFullName -ireplace '\\', '/')" "$(
4343
$InputObject |
4444
ConvertTo-Json -Depth 100 -Compress
45-
)`" `"$ResultSeparator`"
45+
)" "$ResultSeparator"
4646
[UInt32]$ResultSkipIndex = @()
4747
For ([UInt32]$ResultIndex = 0; $ResultIndex -ilt $Result.Count; $ResultIndex++) {
4848
[String]$Item = $Result[$ResultIndex]

hugoalh.GitHubActionsToolkit/module/parameter.psm1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Function Get-Input {
5050
Switch ($PSCmdlet.ParameterSetName) {
5151
'All' {
5252
ForEach ($Item In (Get-ChildItem -Path 'Env:\INPUT_*')) {
53-
$OutputObject[$Item.Name -ireplace '^INPUT_', ''] = $Item.Value
53+
$OutputObject[$Item.Name -ireplace '^INPUT_', ''] = $Trim.IsPresent ? ($Item.Value)?.Trim() : $Item.Value
5454
}
5555
}
5656
'One' {
@@ -72,13 +72,13 @@ Function Get-Input {
7272
'Prefix' {
7373
[RegEx]$InputNameReplaceRegEx = "^INPUT_$([RegEx]::Escape($NamePrefix))"
7474
ForEach ($Item In (Get-ChildItem -Path "Env:\INPUT_$($NamePrefix.ToUpper())*")) {
75-
$OutputObject[$Item.Name -ireplace $InputNameReplaceRegEx, ''] = $Item.Value
75+
$OutputObject[$Item.Name -ireplace $InputNameReplaceRegEx, ''] = $Trim.IsPresent ? ($Item.Value)?.Trim() : $Item.Value
7676
}
7777
}
7878
'Suffix' {
7979
[RegEx]$InputNameReplaceRegEx = "^INPUT_|$([RegEx]::Escape($NameSuffix))$"
8080
ForEach ($Item In (Get-ChildItem -Path "Env:\INPUT_*$($NameSuffix.ToUpper())")) {
81-
$OutputObject[$Item.Name -ireplace $InputNameReplaceRegEx, ''] = $Item.Value
81+
$OutputObject[$Item.Name -ireplace $InputNameReplaceRegEx, ''] = $Trim.IsPresent ? ($Item.Value)?.Trim() : $Item.Value
8282
}
8383
}
8484
}
@@ -121,7 +121,7 @@ Function Get-State {
121121
Switch ($PSCmdlet.ParameterSetName) {
122122
'All' {
123123
ForEach ($Item In (Get-ChildItem -Path 'Env:\STATE_*')) {
124-
$OutputObject[$Item.Name -ireplace '^STATE_', ''] = $Item.Value
124+
$OutputObject[$Item.Name -ireplace '^STATE_', ''] = $Trim.IsPresent ? ($Item.Value)?.Trim() : $Item.Value
125125
}
126126
}
127127
'One' {
@@ -139,13 +139,13 @@ Function Get-State {
139139
'Prefix' {
140140
[RegEx]$StateNameReplaceRegEx = "^STATE_$([RegEx]::Escape($NamePrefix))"
141141
ForEach ($Item In (Get-ChildItem -Path "Env:\STATE_$($NamePrefix.ToUpper())*")) {
142-
$OutputObject[$Item.Name -ireplace $StateNameReplaceRegEx, ''] = $Item.Value
142+
$OutputObject[$Item.Name -ireplace $StateNameReplaceRegEx, ''] = $Trim.IsPresent ? ($Item.Value)?.Trim() : $Item.Value
143143
}
144144
}
145145
'Suffix' {
146146
[RegEx]$StateNameReplaceRegEx = "^STATE_|$([RegEx]::Escape($NameSuffix))$"
147147
ForEach ($Item In (Get-ChildItem -Path "Env:\STATE_*$($NameSuffix.ToUpper())")) {
148-
$OutputObject[$Item.Name -ireplace $StateNameReplaceRegEx, ''] = $Item.Value
148+
$OutputObject[$Item.Name -ireplace $StateNameReplaceRegEx, ''] = $Trim.IsPresent ? ($Item.Value)?.Trim() : $Item.Value
149149
}
150150
}
151151
}

0 commit comments

Comments
 (0)