Skip to content

Commit 4850bd8

Browse files
committed
20230627A
1 parent f4658ad commit 4850bd8

File tree

5 files changed

+32
-17
lines changed

5 files changed

+32
-17
lines changed

hugoalh.GitHubActionsToolkit/module/command-base.psm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#Requires -PSEdition Core -Version 7.2
22
Import-Module -Name (
33
@(
4-
'internal\new-random-token'
4+
'new-random-token'
55
) |
6-
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
7-
) -Prefix 'GitHubActions' -Scope 'Local'
6+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath 'internal' -AdditionalChildPath @("$_.psm1") }
7+
) -Scope 'Local'
88
Class GitHubActionsStdOutCommand {
99
Static [String]EscapeValue([String]$Value) {
1010
Return ($Value -ireplace '%', '%25' -ireplace '\n', '%0A' -ireplace '\r', '%0D')
@@ -58,7 +58,7 @@ Function Write-FileCommand {
5858
Else {
5959
[String]$ItemRaw = "$Name=$Value" -ireplace '\r?\n', ''
6060
Do {
61-
[String]$Token = New-GitHubActionsRandomToken
61+
[String]$Token = New-RandomToken
6262
}
6363
While ($ItemRaw -imatch [RegEx]::Escape($Token))
6464
@(

hugoalh.GitHubActionsToolkit/module/command-control.psm1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
#Requires -PSEdition Core -Version 7.2
22
Import-Module -Name (
33
@(
4-
'command-base',
5-
'internal\new-random-token'
4+
'new-random-token'
5+
) |
6+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath 'internal' -AdditionalChildPath @("$_.psm1") }
7+
) -Scope 'Local'
8+
Import-Module -Name (
9+
@(
10+
'command-base'
611
) |
712
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
813
) -Prefix 'GitHubActions' -Scope 'Local'
@@ -162,7 +167,7 @@ Function New-CommandsEndToken {
162167
[OutputType([String])]
163168
Param ()
164169
Do {
165-
[String]$Result = New-GitHubActionsRandomToken
170+
[String]$Result = New-RandomToken
166171
}
167172
While ($Result -iin $GitHubActionsCommandsEndTokensUsed)
168173
$Script:GitHubActionsCommandsEndTokensUsed += $Result

hugoalh.GitHubActionsToolkit/module/environment-variable.psm1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
#Requires -PSEdition Core -Version 7.2
22
Import-Module -Name (
33
@(
4-
'command-base',
5-
'internal\test-parameter-input-object'
4+
'test-parameter-input-object'
5+
) |
6+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath 'internal' -AdditionalChildPath @("$_.psm1") }
7+
) -Scope 'Local'
8+
Import-Module -Name (
9+
@(
10+
'command-base'
611
) |
712
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
813
) -Prefix 'GitHubActions' -Scope 'Local'
@@ -77,7 +82,7 @@ Function Set-EnvironmentVariable {
7782
[CmdletBinding(DefaultParameterSetName = 'Single', HelpUri = 'https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_setgithubactionsenvironmentvariable')]
7883
[OutputType([Void])]
7984
Param (
80-
[Parameter(Mandatory = $True, ParameterSetName = 'Multiple', Position = 0, ValueFromPipeline = $True)][ValidateScript({ Test-GitHubActionsParameterInputObject -InputObject $_ })][Alias('Input', 'Object')]$InputObject,
85+
[Parameter(Mandatory = $True, ParameterSetName = 'Multiple', Position = 0, ValueFromPipeline = $True)][ValidateScript({ Test-ParameterInputObject -InputObject $_ })][Alias('Input', 'Object')]$InputObject,
8186
[Parameter(Mandatory = $True, ParameterSetName = 'Single', Position = 0, ValueFromPipelineByPropertyName = $True)][ValidateScript({ Test-EnvironmentVariableName -InputObject $_ }, ErrorMessage = '`{0}` is not a valid environment variable name!')][Alias('Key')][String]$Name,
8287
[Parameter(Mandatory = $True, ParameterSetName = 'Single', Position = 1, ValueFromPipelineByPropertyName = $True)][String]$Value,
8388
[Parameter(ValueFromPipelineByPropertyName = $True)][Alias('NoToUpperCase')][Switch]$NoToUpper,

hugoalh.GitHubActionsToolkit/module/nodejs-wrapper.psm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#Requires -PSEdition Core -Version 7.2
22
Import-Module -Name (
33
@(
4-
'internal\new-random-token'
4+
'new-random-token'
55
) |
6-
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
7-
) -Prefix 'GitHubActions' -Scope 'Local'
6+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath 'internal' -AdditionalChildPath @("$_.psm1") }
7+
) -Scope 'Local'
88
[SemVer]$NodeJsVersionMinimum = [SemVer]::Parse('14.15.0')
99
[String]$WrapperRoot = Join-Path -Path $PSScriptRoot -ChildPath 'nodejs-wrapper'
1010
[String]$WrapperPackageFilePath = Join-Path -Path $WrapperRoot -ChildPath 'package.json'
@@ -80,7 +80,7 @@ Function Invoke-NodeJsWrapper {
8080
}
8181
}
8282
Try {
83-
[String]$ResultSeparator = "=====$(New-GitHubActionsRandomToken)====="
83+
[String]$ResultSeparator = "=====$(New-RandomToken)====="
8484
[String]$Base64Name = Convert-FromUtf8StringToBase64String -InputObject $Name
8585
[String]$Base64Argument = $Argument |
8686
ConvertTo-Json -Depth 100 -Compress |

hugoalh.GitHubActionsToolkit/module/parameter.psm1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
#Requires -PSEdition Core -Version 7.2
2+
Import-Module -Name (
3+
@(
4+
'test-parameter-input-object'
5+
) |
6+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath 'internal' -AdditionalChildPath @("$_.psm1") }
7+
) -Scope 'Local'
28
Import-Module -Name (
39
@(
410
'command-base',
5-
'internal\test-parameter-input-object',
611
'log'
712
) |
813
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
@@ -170,7 +175,7 @@ Function Set-Output {
170175
[CmdletBinding(DefaultParameterSetName = 'Single', HelpUri = 'https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_setgithubactionsoutput')]
171176
[OutputType([Void])]
172177
Param (
173-
[Parameter(Mandatory = $True, ParameterSetName = 'Multiple', Position = 0, ValueFromPipeline = $True)][ValidateScript({ Test-GitHubActionsParameterInputObject -InputObject $_ })][Alias('Input', 'Object')]$InputObject,
178+
[Parameter(Mandatory = $True, ParameterSetName = 'Multiple', Position = 0, ValueFromPipeline = $True)][ValidateScript({ Test-ParameterInputObject -InputObject $_ })][Alias('Input', 'Object')]$InputObject,
174179
[Parameter(Mandatory = $True, ParameterSetName = 'Single', Position = 0, ValueFromPipelineByPropertyName = $True)][ValidatePattern('^(?:[\da-z][\da-z_-]*)?[\da-z]$', ErrorMessage = '`{0}` is not a valid GitHub Actions output name!')][Alias('Key')][String]$Name,
175180
[Parameter(Mandatory = $True, ParameterSetName = 'Single', Position = 1, ValueFromPipelineByPropertyName = $True)][AllowEmptyString()][String]$Value
176181
)
@@ -209,7 +214,7 @@ Function Set-State {
209214
[CmdletBinding(DefaultParameterSetName = 'Single', HelpUri = 'https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_setgithubactionsstate')]
210215
[OutputType([Void])]
211216
Param (
212-
[Parameter(Mandatory = $True, ParameterSetName = 'Multiple', Position = 0, ValueFromPipeline = $True)][ValidateScript({ Test-GitHubActionsParameterInputObject -InputObject $_ })][Alias('Input', 'Object')]$InputObject,
217+
[Parameter(Mandatory = $True, ParameterSetName = 'Multiple', Position = 0, ValueFromPipeline = $True)][ValidateScript({ Test-ParameterInputObject -InputObject $_ })][Alias('Input', 'Object')]$InputObject,
213218
[Parameter(Mandatory = $True, ParameterSetName = 'Single', Position = 0, ValueFromPipelineByPropertyName = $True)][ValidatePattern('^(?:[\da-z][\da-z_-]*)?[\da-z]$', ErrorMessage = '`{0}` is not a valid GitHub Actions state name!')][Alias('Key')][String]$Name,
214219
[Parameter(Mandatory = $True, ParameterSetName = 'Single', Position = 1, ValueFromPipelineByPropertyName = $True)][AllowEmptyString()][String]$Value
215220
)

0 commit comments

Comments
 (0)