@@ -11,7 +11,7 @@ Also escape command properties characters.
11
11
String
12
12
#>
13
13
function Format-GHActionsEscapeCharacters {
14
- [CmdletBinding ()]
14
+ [CmdletBinding ()][ OutputType ([ string ])]
15
15
param (
16
16
[Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][AllowEmptyString ()][string ]$InputObject ,
17
17
[switch ]$Command
@@ -34,10 +34,10 @@ An internal function to validate environment variable.
34
34
. PARAMETER InputObject
35
35
Environment variable that need to validate.
36
36
. OUTPUTS
37
- Boolean | Void
37
+ Boolean
38
38
#>
39
39
function Test-GHActionsEnvironmentVariable {
40
- [CmdletBinding ()]
40
+ [CmdletBinding ()][ OutputType ([ bool ])]
41
41
param (
42
42
[Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][string ]$InputObject
43
43
)
@@ -47,6 +47,7 @@ function Test-GHActionsEnvironmentVariable {
47
47
return $true
48
48
}
49
49
Write-Error - Message " Input `" $InputObject `" is not match the require environment variable pattern." - Category SyntaxError
50
+ return $false
50
51
}
51
52
end {}
52
53
}
@@ -65,7 +66,7 @@ Workflow command properties.
65
66
Void
66
67
#>
67
68
function Write-GHActionsCommand {
68
- [CmdletBinding ()]
69
+ [CmdletBinding ()][ OutputType ([ void ])]
69
70
param (
70
71
[Parameter (Mandatory = $true , Position = 0 )][string ]$Command ,
71
72
[Parameter (Mandatory = $true , Position = 1 )][AllowEmptyString ()][string ]$Message ,
@@ -95,7 +96,7 @@ Environment variable value.
95
96
Void
96
97
#>
97
98
function Add-GHActionsEnvironmentVariable {
98
- [CmdletBinding (DefaultParameterSetName = ' single' )]
99
+ [CmdletBinding (DefaultParameterSetName = ' single' )][ OutputType ([ void ])]
99
100
param (
100
101
[Parameter (Mandatory = $true , ParameterSetName = ' multiple' , Position = 0 , ValueFromPipeline = $true )]$InputObject ,
101
102
[Parameter (Mandatory = $true , ParameterSetName = ' single' , Position = 0 )][ValidatePattern (' ^[\da-z_]+$' )][string ]$Name ,
@@ -155,7 +156,7 @@ System path.
155
156
Void
156
157
#>
157
158
function Add-GHActionsPATH {
158
- [CmdletBinding ()]
159
+ [CmdletBinding ()][ OutputType ([ void ])]
159
160
param (
160
161
[Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true , ValueFromPipelineByPropertyName = $true )][string []]$Path
161
162
)
@@ -186,7 +187,7 @@ The secret.
186
187
Void
187
188
#>
188
189
function Add-GHActionsSecretMask {
189
- [CmdletBinding ()]
190
+ [CmdletBinding ()][ OutputType ([ void ])]
190
191
param (
191
192
[Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][string ]$Value
192
193
)
@@ -205,7 +206,7 @@ Disable echoing of workflow commands, the workflow run's log will not show the c
205
206
Void
206
207
#>
207
208
function Disable-GHActionsCommandEcho {
208
- [CmdletBinding ()]
209
+ [CmdletBinding ()][ OutputType ([ void ])]
209
210
param ()
210
211
Write-GHActionsCommand - Command ' echo' - Message ' off'
211
212
}
@@ -218,7 +219,7 @@ Stop processing any workflow commands to allow log anything without accidentally
218
219
String
219
220
#>
220
221
function Disable-GHActionsProcessingCommand {
221
- [CmdletBinding ()]
222
+ [CmdletBinding ()][ OutputType ([ string ])]
222
223
param ()
223
224
[string ]$EndToken = (New-Guid ).Guid
224
225
Write-GHActionsCommand - Command ' stop-commands' - Message $EndToken
@@ -233,7 +234,7 @@ Enable echoing of workflow commands, the workflow run's log will show the comman
233
234
Void
234
235
#>
235
236
function Enable-GHActionsCommandEcho {
236
- [CmdletBinding ()]
237
+ [CmdletBinding ()][ OutputType ([ void ])]
237
238
param ()
238
239
Write-GHActionsCommand - Command ' echo' - Message ' on'
239
240
}
@@ -248,7 +249,7 @@ Token from `Disable-GHActionsProcessingCommand`.
248
249
Void
249
250
#>
250
251
function Enable-GHActionsProcessingCommand {
251
- [CmdletBinding ()]
252
+ [CmdletBinding ()][ OutputType ([ void ])]
252
253
param (
253
254
[Parameter (Mandatory = $true , Position = 0 )][string ]$EndToken
254
255
)
@@ -265,7 +266,7 @@ Title of the log group.
265
266
Void
266
267
#>
267
268
function Enter-GHActionsLogGroup {
268
- [CmdletBinding ()]
269
+ [CmdletBinding ()][ OutputType ([ void ])]
269
270
param (
270
271
[Parameter (Mandatory = $true , Position = 0 )][string ]$Title
271
272
)
@@ -280,7 +281,7 @@ End an expandable group in the log.
280
281
Void
281
282
#>
282
283
function Exit-GHActionsLogGroup {
283
- [CmdletBinding ()]
284
+ [CmdletBinding ()][ OutputType ([ void ])]
284
285
param ()
285
286
Write-GHActionsCommand - Command ' endgroup' - Message ' '
286
287
}
@@ -299,7 +300,7 @@ Trim the input's value.
299
300
Hashtable | String
300
301
#>
301
302
function Get-GHActionsInput {
302
- [CmdletBinding ()]
303
+ [CmdletBinding ()][ OutputType ([ hashtable ] , [ string ])]
303
304
param (
304
305
[Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][string []]$Name ,
305
306
[switch ]$Require ,
@@ -341,7 +342,7 @@ Get debug status.
341
342
Boolean
342
343
#>
343
344
function Get-GHActionsIsDebug {
344
- [CmdletBinding ()]
345
+ [CmdletBinding ()][ OutputType ([ bool ])]
345
346
param ()
346
347
if ($env: RUNNER_DEBUG -eq ' true' ) {
347
348
return $true
@@ -361,7 +362,7 @@ Trim the state's value.
361
362
Hashtable | String
362
363
#>
363
364
function Get-GHActionsState {
364
- [CmdletBinding ()]
365
+ [CmdletBinding ()][ OutputType ([ hashtable ] , [ string ])]
365
366
param (
366
367
[Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][string []]$Name ,
367
368
[switch ]$Trim
@@ -399,7 +400,7 @@ Get the complete webhook event payload.
399
400
PSCustomObject
400
401
#>
401
402
function Get-GHActionsWebhookEventPayload {
402
- [CmdletBinding ()]
403
+ [CmdletBinding ()][ OutputType ([ pscustomobject ])]
403
404
param ()
404
405
return (Get-Content - Path $env: GITHUB_EVENT_PATH - Raw - Encoding utf8NoBOM | ConvertFrom-Json )
405
406
}
@@ -416,7 +417,7 @@ Value of the output.
416
417
Void
417
418
#>
418
419
function Set-GHActionsOutput {
419
- [CmdletBinding ()]
420
+ [CmdletBinding ()][ OutputType ([ void ])]
420
421
param (
421
422
[Parameter (Mandatory = $true , Position = 0 )][string ]$Name ,
422
423
[Parameter (Mandatory = $true , Position = 1 )][string ]$Value
@@ -436,7 +437,7 @@ Value of the state.
436
437
Void
437
438
#>
438
439
function Set-GHActionsState {
439
- [CmdletBinding ()]
440
+ [CmdletBinding ()][ OutputType ([ void ])]
440
441
param (
441
442
[Parameter (Mandatory = $true , Position = 0 )][string ]$Name ,
442
443
[Parameter (Mandatory = $true , Position = 1 )][string ]$Value
@@ -454,7 +455,7 @@ Message that need to log at debug level.
454
455
Void
455
456
#>
456
457
function Write-GHActionsDebug {
457
- [CmdletBinding ()]
458
+ [CmdletBinding ()][ OutputType ([ void ])]
458
459
param (
459
460
[Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][string ]$Message
460
461
)
@@ -487,7 +488,7 @@ Issue title.
487
488
Void
488
489
#>
489
490
function Write-GHActionsError {
490
- [CmdletBinding ()]
491
+ [CmdletBinding ()][ OutputType ([ void ])]
491
492
param (
492
493
[Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][string ]$Message ,
493
494
[Parameter ()][string ]$File ,
@@ -534,7 +535,7 @@ Message that need to log at error level.
534
535
Void
535
536
#>
536
537
function Write-GHActionsFail {
537
- [CmdletBinding ()]
538
+ [CmdletBinding ()][ OutputType ([ void ])]
538
539
param (
539
540
[Parameter (Position = 0 )][string ]$Message = ' '
540
541
)
@@ -564,7 +565,7 @@ Issue title.
564
565
Void
565
566
#>
566
567
function Write-GHActionsNotice {
567
- [CmdletBinding ()]
568
+ [CmdletBinding ()][ OutputType ([ void ])]
568
569
param (
569
570
[Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][string ]$Message ,
570
571
[Parameter ()][string ]$File ,
@@ -623,7 +624,7 @@ Issue title.
623
624
Void
624
625
#>
625
626
function Write-GHActionsWarning {
626
- [CmdletBinding ()]
627
+ [CmdletBinding ()][ OutputType ([ void ])]
627
628
param (
628
629
[Parameter (Mandatory = $true , Position = 0 , ValueFromPipeline = $true )][string ]$Message ,
629
630
[Parameter ()][string ]$File ,
0 commit comments