Skip to content

Commit ed440ba

Browse files
committed
20220507A
1 parent 07c3b3f commit ed440ba

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psm1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ enum GitHubActionsAnnotationType {
1414
.SYNOPSIS
1515
GitHub Actions - Internal - Format Command
1616
.DESCRIPTION
17-
An internal function to escape command characters that could cause issues.
17+
An internal function to escape command characters that can cause issues.
1818
.PARAMETER InputObject
1919
String that need to escape command characters.
2020
.PARAMETER Property
@@ -26,7 +26,7 @@ function Format-GitHubActionsCommand {
2626
[CmdletBinding()][OutputType([string])]
2727
param(
2828
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)][AllowEmptyString()][Alias('Input', 'Object')][string]$InputObject,
29-
[switch]$Property
29+
[Alias('Properties')][switch]$Property
3030
)
3131
begin {}
3232
process {
@@ -57,7 +57,7 @@ function Write-GitHubActionsCommand {
5757
[CmdletBinding()][OutputType([void])]
5858
param (
5959
[Parameter(Mandatory = $true, Position = 0, ValueFromPipelineByPropertyName = $true)][ValidatePattern('^.+$')][string]$Command,
60-
[Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)][AllowEmptyString()][Alias('Content')][string]$Message = '',
60+
[Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)][Alias('Content')][string]$Message = '',
6161
[Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)][Alias('Properties')][hashtable]$Property = @{}
6262
)
6363
begin {}
@@ -92,7 +92,7 @@ function Add-GitHubActionsEnvironmentVariable {
9292
[CmdletBinding(DefaultParameterSetName = 'multiple')][OutputType([void])]
9393
param(
9494
[Parameter(Mandatory = $true, ParameterSetName = 'multiple', Position = 0, ValueFromPipeline = $true)][Alias('Input', 'Object')][hashtable]$InputObject,
95-
[Parameter(Mandatory = $true, ParameterSetName = 'single', Position = 0, ValueFromPipelineByPropertyName = $true)][ValidatePattern('^(?:[\da-z][\da-z_]*)?[\da-z]$')][Alias('Key')][string]$Name,
95+
[Parameter(Mandatory = $true, ParameterSetName = 'single', Position = 0, ValueFromPipelineByPropertyName = $true)][ValidatePattern('^(?:[\da-z][\da-z_-]*)?[\da-z]$')][Alias('Key')][string]$Name,
9696
[Parameter(Mandatory = $true, ParameterSetName = 'single', Position = 1, ValueFromPipelineByPropertyName = $true)][ValidatePattern('^.+$')][string]$Value
9797
)
9898
begin {
@@ -104,7 +104,7 @@ function Add-GitHubActionsEnvironmentVariable {
104104
$InputObject.GetEnumerator() | ForEach-Object -Process {
105105
if ($_.Name.GetType().Name -ne 'string') {
106106
Write-Error -Message "Environment variable name `"$($_.Name)`" must be type of string!" -Category 'InvalidType'
107-
} elseif ($_.Name -notmatch '^(?:[\da-z][\da-z_]*)?[\da-z]$') {
107+
} elseif ($_.Name -notmatch '^(?:[\da-z][\da-z_-]*)?[\da-z]$') {
108108
Write-Error -Message "Environment variable name `"$($_.Name)`" is not match the require pattern!" -Category 'SyntaxError'
109109
} elseif ($_.Value.GetType().Name -ne 'string') {
110110
Write-Error -Message "Environment variable value `"$($_.Value)`" must be type of string!" -Category 'InvalidType'
@@ -297,7 +297,7 @@ function Enable-GitHubActionsProcessingCommand {
297297
param(
298298
[Parameter(Mandatory = $true, Position = 0)][ValidatePattern('^.+$')][Alias('EndKey', 'EndValue', 'Key', 'Token', 'Value')][string]$EndToken
299299
)
300-
return Write-GitHubActionsCommand -Command $EndToken -Message ''
300+
return Write-GitHubActionsCommand -Command $EndToken
301301
}
302302
Set-Alias -Name 'Enable-GHActionsCommandProcessing' -Value 'Enable-GitHubActionsProcessingCommand' -Option 'ReadOnly' -Scope 'Local'
303303
Set-Alias -Name 'Enable-GHActionsProcessingCommand' -Value 'Enable-GitHubActionsProcessingCommand' -Option 'ReadOnly' -Scope 'Local'
@@ -333,7 +333,7 @@ Void
333333
function Exit-GitHubActionsLogGroup {
334334
[CmdletBinding()][OutputType([void])]
335335
param ()
336-
return Write-GitHubActionsCommand -Command 'endgroup' -Message ''
336+
return Write-GitHubActionsCommand -Command 'endgroup'
337337
}
338338
Set-Alias -Name 'Exit-GHActionsGroup' -Value 'Exit-GitHubActionsLogGroup' -Option 'ReadOnly' -Scope 'Local'
339339
Set-Alias -Name 'Exit-GHActionsLogGroup' -Value 'Exit-GitHubActionsLogGroup' -Option 'ReadOnly' -Scope 'Local'
@@ -568,7 +568,7 @@ function Remove-GitHubActionsProblemMatcher {
568568
begin {}
569569
process {
570570
return ($Owner | ForEach-Object -Process {
571-
return Write-GitHubActionsCommand -Command 'remove-matcher' -Message '' -Property @{ 'owner' = $_ }
571+
return Write-GitHubActionsCommand -Command 'remove-matcher' -Property @{ 'owner' = $_ }
572572
})
573573
}
574574
end {}

0 commit comments

Comments
 (0)