@@ -26,7 +26,7 @@ function Format-GitHubActionsCommand {
26
26
[CmdletBinding ()]
27
27
[OutputType ([string ])]
28
28
param (
29
- [Parameter (Position = 0 , ValueFromPipeline = $true )][Alias (' Input' , ' Object' )][string ]$InputObject = ' ' ,
29
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][AllowEmptyString ()][ Alias (' Input' , ' Object' )][string ]$InputObject ,
30
30
[Alias (' Properties' )][switch ]$Property
31
31
)
32
32
begin {}
@@ -240,7 +240,7 @@ function Add-GitHubActionsSecretMask {
240
240
[CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_add-githubactionssecretmask#Add-GitHubActionsSecretMask' )]
241
241
[OutputType ([void ])]
242
242
param (
243
- [Parameter (Position = 0 , ValueFromPipeline = $true , ValueFromPipelineByPropertyName = $true )][Alias (' Key' , ' Secret' , ' Token' )][string ]$Value = ' ' ,
243
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true , ValueFromPipelineByPropertyName = $true )][AllowEmptyString ()][ Alias (' Key' , ' Secret' , ' Token' )][string ]$Value ,
244
244
[Alias (' WithChunk' )][switch ]$WithChunks
245
245
)
246
246
begin {}
@@ -280,14 +280,16 @@ function Add-GitHubActionsStepSummary {
280
280
[CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_add-githubactionsstepsummary#Add-GitHubActionsStepSummary' )]
281
281
[OutputType ([void ])]
282
282
param (
283
- [Parameter (Position = 0 , ValueFromPipeline = $true )][Alias (' Content' )][string []]$Value = @ ( ' ' ) ,
283
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][AllowEmptyCollection ()][ Alias (' Content' )][string []]$Value ,
284
284
[switch ]$NoNewLine
285
285
)
286
286
begin {
287
287
[string []]$Result = @ ()
288
288
}
289
289
process {
290
- $Result += $Value -join " `n "
290
+ if ($Value.Count -gt 0 ) {
291
+ $Result += $Value -join " `n "
292
+ }
291
293
}
292
294
end {
293
295
if ($Result.Count -gt 0 ) {
@@ -877,7 +879,7 @@ function Set-GitHubActionsOutput {
877
879
param (
878
880
[Parameter (Mandatory = $true , ParameterSetName = ' multiple' , Position = 0 , ValueFromPipeline = $true )][Alias (' Input' , ' Object' )][hashtable ]$InputObject ,
879
881
[Parameter (Mandatory = $true , ParameterSetName = ' single' , Position = 0 , ValueFromPipelineByPropertyName = $true )][ValidatePattern (' ^.+$' )][Alias (' Key' )][string ]$Name ,
880
- [Parameter (ParameterSetName = ' single' , Position = 1 , ValueFromPipelineByPropertyName = $true )][string ]$Value = ' '
882
+ [Parameter (Mandatory = $true , ParameterSetName = ' single' , Position = 1 , ValueFromPipelineByPropertyName = $true )][AllowEmptyString ()][ string ]$Value
881
883
)
882
884
begin {}
883
885
process {
@@ -927,7 +929,7 @@ function Set-GitHubActionsState {
927
929
param (
928
930
[Parameter (Mandatory = $true , ParameterSetName = ' multiple' , Position = 0 , ValueFromPipeline = $true )][Alias (' Input' , ' Object' )][hashtable ]$InputObject ,
929
931
[Parameter (Mandatory = $true , ParameterSetName = ' single' , Position = 0 , ValueFromPipelineByPropertyName = $true )][ValidatePattern (' ^.+$' )][Alias (' Key' )][string ]$Name ,
930
- [Parameter (ParameterSetName = ' single' , Position = 1 , ValueFromPipelineByPropertyName = $true )][string ]$Value = ' '
932
+ [Parameter (Mandatory = $true , ParameterSetName = ' single' , Position = 1 , ValueFromPipelineByPropertyName = $true )][AllowEmptyString ()][ string ]$Value
931
933
)
932
934
begin {}
933
935
process {
@@ -975,14 +977,16 @@ function Set-GitHubActionsStepSummary {
975
977
[CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_set-githubactionsstepsummary#Set-GitHubActionsStepSummary' )]
976
978
[OutputType ([void ])]
977
979
param (
978
- [Parameter (Position = 0 , ValueFromPipeline = $true )][Alias (' Content' )][string []]$Value = @ ( ' ' ) ,
980
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][AllowEmptyCollection ()][ Alias (' Content' )][string []]$Value ,
979
981
[switch ]$NoNewLine
980
982
)
981
983
begin {
982
984
[string []]$Result = @ ()
983
985
}
984
986
process {
985
- $Result += $Value -join " `n "
987
+ if ($Value.Count -gt 0 ) {
988
+ $Result += $Value -join " `n "
989
+ }
986
990
}
987
991
end {
988
992
if ($Result.Count -gt 0 ) {
@@ -1075,7 +1079,7 @@ function Write-GitHubActionsAnnotation {
1075
1079
[CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_write-githubactionsannotation#Write-GitHubActionsAnnotation' )]
1076
1080
[OutputType ([void ])]
1077
1081
param (
1078
- [Parameter (Mandatory = $true , Position = 0 , ValueFromPipelineByPropertyName = $true )][GitHubActionsAnnotationType ]$Type ,
1082
+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipelineByPropertyName = $true )][ArgumentCompletions ( ' Error ' , ' Note ' , ' Notice ' , ' Warn ' , ' Warning ' )][ GitHubActionsAnnotationType ]$Type ,
1079
1083
[Parameter (Mandatory = $true , Position = 1 , ValueFromPipelineByPropertyName = $true )][Alias (' Content' )][string ]$Message ,
1080
1084
[Parameter (ValueFromPipelineByPropertyName = $true )][ValidatePattern (' ^.*$' )][Alias (' Path' )][string ]$File ,
1081
1085
[Parameter (ValueFromPipelineByPropertyName = $true )][Alias (' LineStart' , ' StartLine' )][uint ]$Line ,
0 commit comments