@@ -26,7 +26,7 @@ function Format-GitHubActionsCommand {
2626 [CmdletBinding ()]
2727 [OutputType ([string ])]
2828 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 ,
3030 [Alias (' Properties' )][switch ]$Property
3131 )
3232 begin {}
@@ -240,7 +240,7 @@ function Add-GitHubActionsSecretMask {
240240 [CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_add-githubactionssecretmask#Add-GitHubActionsSecretMask' )]
241241 [OutputType ([void ])]
242242 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 ,
244244 [Alias (' WithChunk' )][switch ]$WithChunks
245245 )
246246 begin {}
@@ -280,14 +280,16 @@ function Add-GitHubActionsStepSummary {
280280 [CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_add-githubactionsstepsummary#Add-GitHubActionsStepSummary' )]
281281 [OutputType ([void ])]
282282 param (
283- [Parameter (Position = 0 , ValueFromPipeline = $true )][Alias (' Content' )][string []]$Value = @ ( ' ' ) ,
283+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][AllowEmptyCollection ()][ Alias (' Content' )][string []]$Value ,
284284 [switch ]$NoNewLine
285285 )
286286 begin {
287287 [string []]$Result = @ ()
288288 }
289289 process {
290- $Result += $Value -join " `n "
290+ if ($Value.Count -gt 0 ) {
291+ $Result += $Value -join " `n "
292+ }
291293 }
292294 end {
293295 if ($Result.Count -gt 0 ) {
@@ -877,7 +879,7 @@ function Set-GitHubActionsOutput {
877879 param (
878880 [Parameter (Mandatory = $true , ParameterSetName = ' multiple' , Position = 0 , ValueFromPipeline = $true )][Alias (' Input' , ' Object' )][hashtable ]$InputObject ,
879881 [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
881883 )
882884 begin {}
883885 process {
@@ -927,7 +929,7 @@ function Set-GitHubActionsState {
927929 param (
928930 [Parameter (Mandatory = $true , ParameterSetName = ' multiple' , Position = 0 , ValueFromPipeline = $true )][Alias (' Input' , ' Object' )][hashtable ]$InputObject ,
929931 [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
931933 )
932934 begin {}
933935 process {
@@ -975,14 +977,16 @@ function Set-GitHubActionsStepSummary {
975977 [CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_set-githubactionsstepsummary#Set-GitHubActionsStepSummary' )]
976978 [OutputType ([void ])]
977979 param (
978- [Parameter (Position = 0 , ValueFromPipeline = $true )][Alias (' Content' )][string []]$Value = @ ( ' ' ) ,
980+ [Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][AllowEmptyCollection ()][ Alias (' Content' )][string []]$Value ,
979981 [switch ]$NoNewLine
980982 )
981983 begin {
982984 [string []]$Result = @ ()
983985 }
984986 process {
985- $Result += $Value -join " `n "
987+ if ($Value.Count -gt 0 ) {
988+ $Result += $Value -join " `n "
989+ }
986990 }
987991 end {
988992 if ($Result.Count -gt 0 ) {
@@ -1075,7 +1079,7 @@ function Write-GitHubActionsAnnotation {
10751079 [CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_write-githubactionsannotation#Write-GitHubActionsAnnotation' )]
10761080 [OutputType ([void ])]
10771081 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 ,
10791083 [Parameter (Mandatory = $true , Position = 1 , ValueFromPipelineByPropertyName = $true )][Alias (' Content' )][string ]$Message ,
10801084 [Parameter (ValueFromPipelineByPropertyName = $true )][ValidatePattern (' ^.*$' )][Alias (' Path' )][string ]$File ,
10811085 [Parameter (ValueFromPipelineByPropertyName = $true )][Alias (' LineStart' , ' StartLine' )][uint ]$Line ,
0 commit comments