25
25
function Format-GHActionsCommand {
26
26
[CmdletBinding ()][OutputType ([string ])]
27
27
param (
28
- [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][AllowEmptyString ()][string ]$InputObject ,
28
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][AllowEmptyString ()][Alias ( ' Input ' , ' Object ' )][ string ]$InputObject ,
29
29
[switch ]$Property
30
30
)
31
31
begin {}
@@ -51,7 +51,7 @@ Boolean
51
51
function Test-GHActionsEnvironmentVariable {
52
52
[CmdletBinding ()][OutputType ([bool ])]
53
53
param (
54
- [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][string ]$InputObject
54
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][Alias ( ' Input ' , ' Object ' )][ string ]$InputObject
55
55
)
56
56
begin {}
57
57
process {
@@ -72,8 +72,8 @@ An internal function to write workflow command.
72
72
Workflow command.
73
73
. PARAMETER Message
74
74
Message.
75
- . PARAMETER Properties
76
- Workflow command properties .
75
+ . PARAMETER Property
76
+ Workflow command property .
77
77
. OUTPUTS
78
78
Void
79
79
#>
@@ -82,11 +82,11 @@ function Write-GHActionsCommand {
82
82
param (
83
83
[Parameter (Mandatory = $true , Position = 0 )][ValidatePattern (' ^.+$' )][string ]$Command ,
84
84
[Parameter (Mandatory = $true , Position = 1 )][AllowEmptyString ()][string ]$Message ,
85
- [Parameter (Position = 2 )][hashtable ]$Properties = @ {}
85
+ [Parameter (Position = 2 )][Alias ( ' Properties ' )][ hashtable ]$Property = @ {}
86
86
)
87
87
[string ]$Result = " ::$Command "
88
- if ($Properties .Count -gt 0 ) {
89
- $Result += " $ ( $ ($Properties .GetEnumerator () | ForEach-Object - Process {
88
+ if ($Property .Count -gt 0 ) {
89
+ $Result += " $ ( $ ($Property .GetEnumerator () | ForEach-Object - Process {
90
90
return " $ ( $_.Name ) =$ ( Format-GHActionsCommand - InputObject $_.Value - Property) "
91
91
}) -join ' ,' ) "
92
92
}
110
110
function Add-GHActionsEnvironmentVariable {
111
111
[CmdletBinding (DefaultParameterSetName = ' 1' )][OutputType ([void ])]
112
112
param (
113
- [Parameter (Mandatory = $true , ParameterSetName = ' 1' , Position = 0 , ValueFromPipeline = $true )]$InputObject ,
114
- [Parameter (Mandatory = $true , ParameterSetName = ' 2' , Position = 0 )][ValidatePattern (' ^[\da-z_]+$' )][string ]$Name ,
113
+ [Parameter (Mandatory = $true , ParameterSetName = ' 1' , Position = 0 , ValueFromPipeline = $true )][ Alias ( ' Input ' , ' Object ' )] $InputObject ,
114
+ [Parameter (Mandatory = $true , ParameterSetName = ' 2' , Position = 0 )][ValidatePattern (' ^[\da-z_]+$' )][Alias ( ' Key ' )][ string ]$Name ,
115
115
[Parameter (Mandatory = $true , ParameterSetName = ' 2' , Position = 1 )][ValidatePattern (' ^.+$' )][string ]$Value
116
116
)
117
117
begin {
164
164
function Add-GHActionsPATH {
165
165
[CmdletBinding ()][OutputType ([void ])]
166
166
param (
167
- [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true , ValueFromPipelineByPropertyName = $true )][string []]$Path
167
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true , ValueFromPipelineByPropertyName = $true )][Alias ( ' Paths ' )][ string []]$Path
168
168
)
169
169
begin {
170
170
[string []]$Result = @ ()
@@ -185,7 +185,7 @@ function Add-GHActionsPATH {
185
185
function Add-GHActionsProblemMatcher {
186
186
[CmdletBinding ()][OutputType ([void ])]
187
187
param (
188
- [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true , ValueFromPipelineByPropertyName = $true )][SupportsWildcards ()][string []]$Path
188
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true , ValueFromPipelineByPropertyName = $true )][SupportsWildcards ()][Alias ( ' File ' , ' Files ' , ' Paths ' , ' PSPath ' , ' PSPaths ' )][ string []]$Path
189
189
)
190
190
begin {}
191
191
process {
212
212
function Add-GHActionsSecretMask {
213
213
[CmdletBinding ()][OutputType ([void ])]
214
214
param (
215
- [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][string ]$Value
215
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][Alias ( ' Key ' , ' Token ' )][ string ]$Value
216
216
)
217
217
begin {}
218
218
process {
@@ -247,7 +247,7 @@ String
247
247
function Disable-GHActionsProcessingCommand {
248
248
[CmdletBinding ()][OutputType ([string ])]
249
249
param (
250
- [Parameter (Position = 0 )][ValidatePattern (' ^.+$' )][string ]$EndToken = (New-Guid ).Guid
250
+ [Parameter (Position = 0 )][ValidatePattern (' ^.+$' )][Alias ( ' Key ' , ' Token ' , ' Value ' )][ string ]$EndToken = (New-Guid ).Guid
251
251
)
252
252
Write-GHActionsCommand - Command ' stop-commands' - Message $EndToken
253
253
return $EndToken
280
280
function Enable-GHActionsProcessingCommand {
281
281
[CmdletBinding ()][OutputType ([void ])]
282
282
param (
283
- [Parameter (Mandatory = $true , Position = 0 )][ValidatePattern (' ^.+$' )][string ]$EndToken
283
+ [Parameter (Mandatory = $true , Position = 0 )][ValidatePattern (' ^.+$' )][Alias ( ' Key ' , ' Token ' , ' Value ' )][ string ]$EndToken
284
284
)
285
285
Write-GHActionsCommand - Command $EndToken - Message ' '
286
286
}
298
298
function Enter-GHActionsLogGroup {
299
299
[CmdletBinding ()][OutputType ([void ])]
300
300
param (
301
- [Parameter (Mandatory = $true , Position = 0 )][ValidatePattern (' ^.+$' )][string ]$Title
301
+ [Parameter (Mandatory = $true , Position = 0 )][ValidatePattern (' ^.+$' )][Alias ( ' Header ' , ' Message ' )][ string ]$Title
302
302
)
303
303
Write-GHActionsCommand - Command ' group' - Message $Title
304
304
}
@@ -334,8 +334,8 @@ Hashtable | String
334
334
function Get-GHActionsInput {
335
335
[CmdletBinding ()][OutputType ([hashtable ], [string ])]
336
336
param (
337
- [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][string []]$Name ,
338
- [switch ]$Require ,
337
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][Alias ( ' Key ' , ' Keys ' , ' Names ' )][ string []]$Name ,
338
+ [Alias ( ' Required ' )][ switch ]$Require ,
339
339
[switch ]$Trim
340
340
)
341
341
begin {
@@ -396,7 +396,7 @@ Hashtable | String
396
396
function Get-GHActionsState {
397
397
[CmdletBinding ()][OutputType ([hashtable ], [string ])]
398
398
param (
399
- [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][string []]$Name ,
399
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][Alias ( ' Key ' , ' Keys ' , ' Names ' )][ string []]$Name ,
400
400
[switch ]$Trim
401
401
)
402
402
begin {
@@ -423,6 +423,7 @@ function Get-GHActionsState {
423
423
return $Result
424
424
}
425
425
}
426
+ Set-Alias - Name ' Restore-GHActionsState' - Value ' Get-GHActionsState' - Option ReadOnly - Scope ' Local'
426
427
<#
427
428
. SYNOPSIS
428
429
GitHub Actions - Get Webhook Event Payload
@@ -436,7 +437,7 @@ Hashtable | PSCustomObject
436
437
function Get-GHActionsWebhookEventPayload {
437
438
[CmdletBinding ()][OutputType ([hashtable ], [pscustomobject ])]
438
439
param (
439
- [switch ]$AsHashTable
440
+ [Alias ( ' ToHashTable ' )][ switch ]$AsHashTable
440
441
)
441
442
return (Get-Content - Path $env: GITHUB_EVENT_PATH - Raw - Encoding utf8NoBOM | ConvertFrom-Json - AsHashtable:$AsHashTable )
442
443
}
@@ -445,12 +446,12 @@ Set-Alias -Name 'Get-GHActionsPayload' -Value 'Get-GHActionsWebhookEventPayload'
445
446
function Remove-GHActionsProblemMatcher {
446
447
[CmdletBinding ()][OutputType ([void ])]
447
448
param (
448
- [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true , ValueFromPipelineByPropertyName = $true )][string []]$Owner
449
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true , ValueFromPipelineByPropertyName = $true )][Alias ( ' Identifies ' , ' Identify ' , ' Identifier ' , ' Identifiers ' , ' Key ' , ' Keys ' , ' Name ' , ' Names ' , ' Owners ' )][ string []]$Owner
449
450
)
450
451
begin {}
451
452
process {
452
453
$Owner | ForEach-Object - Process {
453
- Write-GHActionsCommand - Command ' remove-matcher' - Message ' ' - Properties @ { ' owner' = $_ }
454
+ Write-GHActionsCommand - Command ' remove-matcher' - Message ' ' - Property @ { ' owner' = $_ }
454
455
}
455
456
}
456
457
end {}
@@ -470,10 +471,10 @@ Void
470
471
function Set-GHActionsOutput {
471
472
[CmdletBinding ()][OutputType ([void ])]
472
473
param (
473
- [Parameter (Mandatory = $true , Position = 0 )][ValidatePattern (' ^.+$' )][string ]$Name ,
474
+ [Parameter (Mandatory = $true , Position = 0 )][ValidatePattern (' ^.+$' )][Alias ( ' Key ' )][ string ]$Name ,
474
475
[Parameter (Mandatory = $true , Position = 1 )][string ]$Value
475
476
)
476
- Write-GHActionsCommand - Command ' set-output' - Message $Value - Properties @ { ' name' = $Name }
477
+ Write-GHActionsCommand - Command ' set-output' - Message $Value - Property @ { ' name' = $Name }
477
478
}
478
479
<#
479
480
. SYNOPSIS
@@ -490,11 +491,12 @@ Void
490
491
function Set-GHActionsState {
491
492
[CmdletBinding ()][OutputType ([void ])]
492
493
param (
493
- [Parameter (Mandatory = $true , Position = 0 )][ValidatePattern (' ^.+$' )][string ]$Name ,
494
+ [Parameter (Mandatory = $true , Position = 0 )][ValidatePattern (' ^.+$' )][Alias ( ' Key ' )][ string ]$Name ,
494
495
[Parameter (Mandatory = $true , Position = 1 )][string ]$Value
495
496
)
496
- Write-GHActionsCommand - Command ' save-state' - Message $Value - Properties @ { ' name' = $Name }
497
+ Write-GHActionsCommand - Command ' save-state' - Message $Value - Property @ { ' name' = $Name }
497
498
}
499
+ Set-Alias - Name ' Save-GHActionsState' - Value ' Set-GHActionsState' - Option ReadOnly - Scope ' Local'
498
500
<#
499
501
. SYNOPSIS
500
502
GitHub Actions - Write Annotation
@@ -508,7 +510,7 @@ Message that need to log at annotation.
508
510
Issue file path.
509
511
. PARAMETER Line
510
512
Issue file line start.
511
- . PARAMETER Col
513
+ . PARAMETER Column
512
514
Issue file column start.
513
515
. PARAMETER EndLine
514
516
Issue file line end.
@@ -524,22 +526,22 @@ function Write-GHActionsAnnotation {
524
526
param (
525
527
[Parameter (Mandatory = $true , Position = 0 )][GHActionsAnnotationType ]$Type ,
526
528
[Parameter (Mandatory = $true , Position = 1 )][string ]$Message ,
527
- [Parameter ()][ValidatePattern (' ^.*$' )][string ]$File ,
529
+ [Parameter ()][ValidatePattern (' ^.*$' )][Alias ( ' Path ' )][ string ]$File ,
528
530
[Parameter ()][uint ]$Line ,
529
- [Parameter ()][uint ]$Col ,
531
+ [Parameter ()][Alias ( ' Col ' )][ uint ]$Column ,
530
532
[Parameter ()][uint ]$EndLine ,
531
533
[Parameter ()][uint ]$EndColumn ,
532
- [Parameter ()][ValidatePattern (' ^.*$' )][string ]$Title
534
+ [Parameter ()][ValidatePattern (' ^.*$' )][Alias ( ' Header ' )][ string ]$Title
533
535
)
534
- [hashtable ]$Properties = @ {}
536
+ [hashtable ]$Property = @ {}
535
537
if ($File.Length -gt 0 ) {
536
538
$Properties .' file' = $File
537
539
}
538
540
if ($Line -gt 0 ) {
539
541
$Properties .' line' = $Line
540
542
}
541
- if ($Col -gt 0 ) {
542
- $Properties .' col' = $Col
543
+ if ($Column -gt 0 ) {
544
+ $Properties .' col' = $Column
543
545
}
544
546
if ($EndLine -gt 0 ) {
545
547
$Properties .' endLine' = $EndLine
@@ -550,7 +552,7 @@ function Write-GHActionsAnnotation {
550
552
if ($Title.Length -gt 0 ) {
551
553
$Properties .' title' = $Title
552
554
}
553
- Write-GHActionsCommand - Command $Type.ToString ().ToLower() - Message $Message - Properties $Properties
555
+ Write-GHActionsCommand - Command $Type.ToString ().ToLower() - Message $Message - Property $Property
554
556
}
555
557
<#
556
558
. SYNOPSIS
@@ -599,14 +601,14 @@ function Write-GHActionsError {
599
601
[CmdletBinding ()][OutputType ([void ])]
600
602
param (
601
603
[Parameter (Mandatory = $true , Position = 0 )][string ]$Message ,
602
- [Parameter ()][ValidatePattern (' ^.*$' )][string ]$File ,
604
+ [Parameter ()][ValidatePattern (' ^.*$' )][Alias ( ' Path ' )][ string ]$File ,
603
605
[Parameter ()][uint ]$Line ,
604
- [Parameter ()][uint ]$Col ,
606
+ [Parameter ()][Alias ( ' Col ' )][ uint ]$Column ,
605
607
[Parameter ()][uint ]$EndLine ,
606
608
[Parameter ()][uint ]$EndColumn ,
607
- [Parameter ()][ValidatePattern (' ^.*$' )][string ]$Title
609
+ [Parameter ()][ValidatePattern (' ^.*$' )][Alias ( ' Header ' )][ string ]$Title
608
610
)
609
- Write-GHActionsAnnotation - Type ' Error' - Message $Message - File $File - Line $Line - Col $Col - EndLine $EndLine - EndColumn $EndColumn - Title $Title
611
+ Write-GHActionsAnnotation - Type ' Error' - Message $Message - File $File - Line $Line - Column $Column - EndLine $EndLine - EndColumn $EndColumn - Title $Title
610
612
}
611
613
<#
612
614
. SYNOPSIS
@@ -652,14 +654,14 @@ function Write-GHActionsNotice {
652
654
[CmdletBinding ()][OutputType ([void ])]
653
655
param (
654
656
[Parameter (Mandatory = $true , Position = 0 )][string ]$Message ,
655
- [Parameter ()][ValidatePattern (' ^.*$' )][string ]$File ,
657
+ [Parameter ()][ValidatePattern (' ^.*$' )][Alias ( ' Path ' )][ string ]$File ,
656
658
[Parameter ()][uint ]$Line ,
657
- [Parameter ()][uint ]$Col ,
659
+ [Parameter ()][Alias ( ' Col ' )][ uint ]$Column ,
658
660
[Parameter ()][uint ]$EndLine ,
659
661
[Parameter ()][uint ]$EndColumn ,
660
- [Parameter ()][ValidatePattern (' ^.*$' )][string ]$Title
662
+ [Parameter ()][ValidatePattern (' ^.*$' )][Alias ( ' Header ' )][ string ]$Title
661
663
)
662
- Write-GHActionsAnnotation - Type ' Notice' - Message $Message - File $File - Line $Line - Col $Col - EndLine $EndLine - EndColumn $EndColumn - Title $Title
664
+ Write-GHActionsAnnotation - Type ' Notice' - Message $Message - File $File - Line $Line - Column $Column - EndLine $EndLine - EndColumn $EndColumn - Title $Title
663
665
}
664
666
Set-Alias - Name ' Write-GHActionsNote' - Value ' Write-GHActionsNotice' - Option ReadOnly - Scope ' Local'
665
667
<#
@@ -688,14 +690,14 @@ function Write-GHActionsWarning {
688
690
[CmdletBinding ()][OutputType ([void ])]
689
691
param (
690
692
[Parameter (Mandatory = $true , Position = 0 )][string ]$Message ,
691
- [Parameter ()][ValidatePattern (' ^.*$' )][string ]$File ,
693
+ [Parameter ()][ValidatePattern (' ^.*$' )][Alias ( ' Path ' )][ string ]$File ,
692
694
[Parameter ()][uint ]$Line ,
693
- [Parameter ()][uint ]$Col ,
695
+ [Parameter ()][Alias ( ' Col ' )][ uint ]$Column ,
694
696
[Parameter ()][uint ]$EndLine ,
695
697
[Parameter ()][uint ]$EndColumn ,
696
- [Parameter ()][ValidatePattern (' ^.*$' )][string ]$Title
698
+ [Parameter ()][ValidatePattern (' ^.*$' )][Alias ( ' Header ' )][ string ]$Title
697
699
)
698
- Write-GHActionsAnnotation - Type ' Warning' - Message $Message - File $File - Line $Line - Col $Col - EndLine $EndLine - EndColumn $EndColumn - Title $Title
700
+ Write-GHActionsAnnotation - Type ' Warning' - Message $Message - File $File - Line $Line - Column $Column - EndLine $EndLine - EndColumn $EndColumn - Title $Title
699
701
}
700
702
Set-Alias - Name ' Write-GHActionsWarn' - Value ' Write-GHActionsWarning' - Option ReadOnly - Scope ' Local'
701
703
Export-ModuleMember - Function @ (
@@ -734,6 +736,8 @@ Export-ModuleMember -Function @(
734
736
' Exit-GHActionsGroup' ,
735
737
' Get-GHActionsEvent' ,
736
738
' Get-GHActionsPayload' ,
739
+ ' Restore-GHActionsState' ,
740
+ ' Save-GHActionsState' ,
737
741
' Write-GHActionsNote' ,
738
742
' Write-GHActionsWarn'
739
743
)
0 commit comments