@@ -14,7 +14,7 @@ enum GitHubActionsAnnotationType {
14
14
. SYNOPSIS
15
15
GitHub Actions - Internal - Format Command
16
16
. 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.
18
18
. PARAMETER InputObject
19
19
String that need to escape command characters.
20
20
. PARAMETER Property
@@ -26,7 +26,7 @@ function Format-GitHubActionsCommand {
26
26
[CmdletBinding ()][OutputType ([string ])]
27
27
param (
28
28
[Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][AllowEmptyString ()][Alias (' Input' , ' Object' )][string ]$InputObject ,
29
- [switch ]$Property
29
+ [Alias ( ' Properties ' )][ switch ]$Property
30
30
)
31
31
begin {}
32
32
process {
@@ -57,7 +57,7 @@ function Write-GitHubActionsCommand {
57
57
[CmdletBinding ()][OutputType ([void ])]
58
58
param (
59
59
[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 = ' ' ,
61
61
[Parameter (Position = 2 , ValueFromPipelineByPropertyName = $true )][Alias (' Properties' )][hashtable ]$Property = @ {}
62
62
)
63
63
begin {}
@@ -92,7 +92,7 @@ function Add-GitHubActionsEnvironmentVariable {
92
92
[CmdletBinding (DefaultParameterSetName = ' multiple' )][OutputType ([void ])]
93
93
param (
94
94
[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 ,
96
96
[Parameter (Mandatory = $true , ParameterSetName = ' single' , Position = 1 , ValueFromPipelineByPropertyName = $true )][ValidatePattern (' ^.+$' )][string ]$Value
97
97
)
98
98
begin {
@@ -104,7 +104,7 @@ function Add-GitHubActionsEnvironmentVariable {
104
104
$InputObject.GetEnumerator () | ForEach-Object - Process {
105
105
if ($_.Name.GetType ().Name -ne ' string' ) {
106
106
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]$' ) {
108
108
Write-Error - Message " Environment variable name `" $ ( $_.Name ) `" is not match the require pattern!" - Category ' SyntaxError'
109
109
} elseif ($_.Value.GetType ().Name -ne ' string' ) {
110
110
Write-Error - Message " Environment variable value `" $ ( $_.Value ) `" must be type of string!" - Category ' InvalidType'
@@ -297,7 +297,7 @@ function Enable-GitHubActionsProcessingCommand {
297
297
param (
298
298
[Parameter (Mandatory = $true , Position = 0 )][ValidatePattern (' ^.+$' )][Alias (' EndKey' , ' EndValue' , ' Key' , ' Token' , ' Value' )][string ]$EndToken
299
299
)
300
- return Write-GitHubActionsCommand - Command $EndToken - Message ' '
300
+ return Write-GitHubActionsCommand - Command $EndToken
301
301
}
302
302
Set-Alias - Name ' Enable-GHActionsCommandProcessing' - Value ' Enable-GitHubActionsProcessingCommand' - Option ' ReadOnly' - Scope ' Local'
303
303
Set-Alias - Name ' Enable-GHActionsProcessingCommand' - Value ' Enable-GitHubActionsProcessingCommand' - Option ' ReadOnly' - Scope ' Local'
333
333
function Exit-GitHubActionsLogGroup {
334
334
[CmdletBinding ()][OutputType ([void ])]
335
335
param ()
336
- return Write-GitHubActionsCommand - Command ' endgroup' - Message ' '
336
+ return Write-GitHubActionsCommand - Command ' endgroup'
337
337
}
338
338
Set-Alias - Name ' Exit-GHActionsGroup' - Value ' Exit-GitHubActionsLogGroup' - Option ' ReadOnly' - Scope ' Local'
339
339
Set-Alias - Name ' Exit-GHActionsLogGroup' - Value ' Exit-GitHubActionsLogGroup' - Option ' ReadOnly' - Scope ' Local'
@@ -568,7 +568,7 @@ function Remove-GitHubActionsProblemMatcher {
568
568
begin {}
569
569
process {
570
570
return ($Owner | ForEach-Object - Process {
571
- return Write-GitHubActionsCommand - Command ' remove-matcher' - Message ' ' - Property @ { ' owner' = $_ }
571
+ return Write-GitHubActionsCommand - Command ' remove-matcher' - Property @ { ' owner' = $_ }
572
572
})
573
573
}
574
574
end {}
0 commit comments