2
2
Import-Module - Name @ (
3
3
(Join-Path - Path $PSScriptRoot - ChildPath ' command-stdout.psm1' )
4
4
) - Prefix ' GitHubActions' - Scope ' Local'
5
- [UInt64 ]$AnnotationMessageLengthMaximum = 4096
5
+ [UInt64 ]$AnnotationDataLengthMaximum = 4096
6
6
<#
7
7
. SYNOPSIS
8
8
GitHub Actions - Enter Log Group
@@ -44,8 +44,8 @@ GitHub Actions - Internal - Write Annotation
44
44
Print an annotation message to the log.
45
45
. PARAMETER Type
46
46
Type of the annotation.
47
- . PARAMETER Message
48
- Message of the annotation.
47
+ . PARAMETER Data
48
+ Data of the annotation.
49
49
. PARAMETER File
50
50
Path of the issue file of the annotation.
51
51
. PARAMETER Line
@@ -68,7 +68,7 @@ Function Write-Annotation {
68
68
[OutputType ([Void ])]
69
69
Param (
70
70
[Parameter (Mandatory = $True , Position = 0 , ValueFromPipelineByPropertyName = $True )][ValidateSet (' error' , ' notice' , ' warning' )][String ]$Type ,
71
- [Parameter (Mandatory = $True , Position = 1 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][Alias (' Content' )][String ]$Message ,
71
+ [Parameter (Mandatory = $True , Position = 1 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][Alias (' Content' , ' Message ' )][String ]$Data ,
72
72
[Parameter (ValueFromPipelineByPropertyName = $True )][AllowEmptyString ()][AllowNull ()][ValidatePattern (' ^.*$' , ErrorMessage = ' Value is not a single line string!' )][Alias (' Path' )][String ]$File ,
73
73
[Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' LineStart' , ' StartLine' )][UInt32 ]$Line ,
74
74
[Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Col' , ' ColStart' , ' ColumnStart' , ' StartCol' , ' StartColumn' )][UInt32 ]$Column ,
@@ -97,19 +97,19 @@ Function Write-Annotation {
97
97
If ($Title.Length -gt 0 ) {
98
98
$Parameter .(' title' ) = $Title
99
99
}
100
- If ($Message .Length -gt $AnnotationMessageLengthMaximum -and $Summary.Length -gt 0 ) {
101
- If ($Message -imatch ' ^::' ) {
100
+ If ($Data .Length -gt $AnnotationDataLengthMaximum -and $Summary.Length -gt 0 ) {
101
+ If ($Data -imatch ' ^::' ) {
102
102
[String ]$EndToken = Disable-GitHubActionsStdOutCommandProcess
103
- Write-Host - Object $Message
103
+ Write-Host - Object $Data
104
104
Enable-GitHubActionsStdOutCommandProcess - EndToken $EndToken
105
105
}
106
106
Else {
107
- Write-Host - Object $Message
107
+ Write-Host - Object $Data
108
108
}
109
109
Write-GitHubActionsStdOutCommand - StdOutCommand $Type - Parameter $Parameter - Value $Summary
110
110
}
111
111
Else {
112
- Write-GitHubActionsStdOutCommand - StdOutCommand $Type - Parameter $Parameter - Value $Message
112
+ Write-GitHubActionsStdOutCommand - StdOutCommand $Type - Parameter $Parameter - Value $Data
113
113
}
114
114
}
115
115
}
@@ -133,20 +133,19 @@ Function Write-Debug {
133
133
[OutputType ([String ], ParameterSetName = ' PassThru' )]
134
134
[OutputType ([Void ], ParameterSetName = ' Void' )]
135
135
Param (
136
- [Parameter (Mandatory = $True , Position = 0 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][AllowEmptyString ()][AllowNull ()][Alias (' Content' )][String ]$Message ,
137
- [Alias (' SkipEmpty ' )][Switch ]$SkipEmptyMessage ,
136
+ [Parameter (Mandatory = $True , Position = 0 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][AllowEmptyString ()][AllowNull ()][Alias (' Content' , ' Message ' )][String ]$Data ,
137
+ [Alias (' SkipEmptyMessage ' )][Switch ]$SkipEmpty ,
138
138
[Parameter (Mandatory = $True , ParameterSetName = ' PassThru' )][Switch ]$PassThru
139
139
)
140
140
Process {
141
141
If (
142
- ! $SkipEmptyMessage .IsPresent -or
143
- ($SkipEmptyMessage .IsPresent -and $Message .Length -gt 0 )
142
+ ! $SkipEmpty .IsPresent -or
143
+ ($SkipEmpty .IsPresent -and $Data .Length -gt 0 )
144
144
) {
145
- Write-GitHubActionsStdOutCommand - StdOutCommand ' debug' - Value $Message
145
+ Write-GitHubActionsStdOutCommand - StdOutCommand ' debug' - Value $Data
146
146
}
147
147
If ($PSCmdlet.ParameterSetName -ieq ' PassThru' ) {
148
- $Message |
149
- Write-Output
148
+ Write-Output - InputObject $Data
150
149
}
151
150
}
152
151
}
@@ -155,8 +154,8 @@ Function Write-Debug {
155
154
GitHub Actions - Write Error
156
155
. DESCRIPTION
157
156
Print an error message to the log.
158
- . PARAMETER Message
159
- Message that need to log at error level.
157
+ . PARAMETER Data
158
+ Data that need to log at error level.
160
159
. PARAMETER File
161
160
Path of the issue file of the annotation.
162
161
. PARAMETER Line
@@ -178,7 +177,7 @@ Function Write-Error {
178
177
[CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_writegithubactionserror' )]
179
178
[OutputType ([Void ])]
180
179
Param (
181
- [Parameter (Mandatory = $True , Position = 0 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][Alias (' Content' )][String ]$Message ,
180
+ [Parameter (Mandatory = $True , Position = 0 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][Alias (' Content' , ' Message ' )][String ]$Data ,
182
181
[Parameter (ValueFromPipelineByPropertyName = $True )][AllowEmptyString ()][AllowNull ()][ValidatePattern (' ^.*$' , ErrorMessage = ' Value is not a single line string!' )][Alias (' Path' )][String ]$File ,
183
182
[Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' LineStart' , ' StartLine' )][UInt32 ]$Line ,
184
183
[Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Col' , ' ColStart' , ' ColumnStart' , ' StartCol' , ' StartColumn' )][UInt32 ]$Column ,
@@ -188,16 +187,16 @@ Function Write-Error {
188
187
[Parameter (ValueFromPipelineByPropertyName = $True )][AllowEmptyString ()][AllowNull ()][String ]$Summary
189
188
)
190
189
Process {
191
- Write-Annotation - Type ' error' - Message $Message - File $File - Line $Line - Column $Column - EndLine $EndLine - EndColumn $EndColumn - Title $Title - Summary $Summary
190
+ Write-Annotation - Type ' error' - Data $Data - File $File - Line $Line - Column $Column - EndLine $EndLine - EndColumn $EndColumn - Title $Title - Summary $Summary
192
191
}
193
192
}
194
193
<#
195
194
. SYNOPSIS
196
195
GitHub Actions - Write Fail
197
196
. DESCRIPTION
198
197
Print an error message to the log and end the process.
199
- . PARAMETER Message
200
- Message that need to log at error level.
198
+ . PARAMETER Data
199
+ Data that need to log at error level.
201
200
. PARAMETER File
202
201
Path of the issue file of the annotation.
203
202
. PARAMETER Line
@@ -223,7 +222,7 @@ Function Write-Fail {
223
222
[CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_writegithubactionsfail' )]
224
223
[OutputType ([Void ])]
225
224
Param (
226
- [Parameter (Mandatory = $True , Position = 0 )][Alias (' Content' )][String ]$Message ,
225
+ [Parameter (Mandatory = $True , Position = 0 )][Alias (' Content' , ' Message ' )][String ]$Data ,
227
226
[AllowEmptyString ()][AllowNull ()][ValidatePattern (' ^.*$' , ErrorMessage = ' Value is not a single line string!' )][Alias (' Path' )][String ]$File ,
228
227
[Alias (' LineStart' , ' StartLine' )][UInt32 ]$Line ,
229
228
[Alias (' Col' , ' ColStart' , ' ColumnStart' , ' StartCol' , ' StartColumn' )][UInt32 ]$Column ,
@@ -234,7 +233,7 @@ Function Write-Fail {
234
233
[ScriptBlock ]$Finally = {},
235
234
[ValidateScript ({ $_ -ine 0 }, ErrorMessage = ' Value is not a valid non-success exit code!' )][Int16 ]$ExitCode = 1
236
235
)
237
- Write-Annotation - Type ' error' - Message $Message - File $File - Line $Line - Column $Column - EndLine $EndLine - EndColumn $EndColumn - Title $Title - Summary $Summary
236
+ Write-Annotation - Type ' error' - Data $Data - File $File - Line $Line - Column $Column - EndLine $EndLine - EndColumn $EndColumn - Title $Title - Summary $Summary
238
237
Invoke-Command - ScriptBlock $Finally - ErrorAction ' Continue'
239
238
Exit $ExitCode
240
239
Exit 1 # Fallback exit for safety.
@@ -244,8 +243,8 @@ Function Write-Fail {
244
243
GitHub Actions - Write Notice
245
244
. DESCRIPTION
246
245
Print a notice message to the log.
247
- . PARAMETER Message
248
- Message that need to log at notice level.
246
+ . PARAMETER Data
247
+ Data that need to log at notice level.
249
248
. PARAMETER File
250
249
Path of the issue file of the annotation.
251
250
. PARAMETER Line
@@ -267,7 +266,7 @@ Function Write-Notice {
267
266
[CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_writegithubactionsnotice' )]
268
267
[OutputType ([Void ])]
269
268
Param (
270
- [Parameter (Mandatory = $True , Position = 0 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][Alias (' Content' )][String ]$Message ,
269
+ [Parameter (Mandatory = $True , Position = 0 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][Alias (' Content' , ' Message ' )][String ]$Data ,
271
270
[Parameter (ValueFromPipelineByPropertyName = $True )][AllowEmptyString ()][AllowNull ()][ValidatePattern (' ^.*$' , ErrorMessage = ' Value is not a single line string!' )][Alias (' Path' )][String ]$File ,
272
271
[Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' LineStart' , ' StartLine' )][UInt32 ]$Line ,
273
272
[Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Col' , ' ColStart' , ' ColumnStart' , ' StartCol' , ' StartColumn' )][UInt32 ]$Column ,
@@ -277,7 +276,7 @@ Function Write-Notice {
277
276
[Parameter (ValueFromPipelineByPropertyName = $True )][AllowEmptyString ()][AllowNull ()][String ]$Summary
278
277
)
279
278
Process {
280
- Write-Annotation - Type ' notice' - Message $Message - File $File - Line $Line - Column $Column - EndLine $EndLine - EndColumn $EndColumn - Title $Title - Summary $Summary
279
+ Write-Annotation - Type ' notice' - Data $Data - File $File - Line $Line - Column $Column - EndLine $EndLine - EndColumn $EndColumn - Title $Title - Summary $Summary
281
280
}
282
281
}
283
282
Set-Alias - Name ' Write-Note' - Value ' Write-Notice' - Option ' ReadOnly' - Scope ' Local'
@@ -286,8 +285,8 @@ Set-Alias -Name 'Write-Note' -Value 'Write-Notice' -Option 'ReadOnly' -Scope 'Lo
286
285
GitHub Actions - Write Warning
287
286
. DESCRIPTION
288
287
Print a warning message to the log.
289
- . PARAMETER Message
290
- Message that need to log at warning level.
288
+ . PARAMETER Data
289
+ Data that need to log at warning level.
291
290
. PARAMETER File
292
291
Path of the issue file of the annotation.
293
292
. PARAMETER Line
@@ -309,7 +308,7 @@ Function Write-Warning {
309
308
[CmdletBinding (HelpUri = ' https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_writegithubactionswarning' )]
310
309
[OutputType ([Void ])]
311
310
Param (
312
- [Parameter (Mandatory = $True , Position = 0 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][Alias (' Content' )][String ]$Message ,
311
+ [Parameter (Mandatory = $True , Position = 0 , ValueFromPipeline = $True , ValueFromPipelineByPropertyName = $True )][Alias (' Content' , ' Message ' )][String ]$Data ,
313
312
[Parameter (ValueFromPipelineByPropertyName = $True )][AllowEmptyString ()][AllowNull ()][ValidatePattern (' ^.*$' , ErrorMessage = ' Value is not a single line string!' )][Alias (' Path' )][String ]$File ,
314
313
[Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' LineStart' , ' StartLine' )][UInt32 ]$Line ,
315
314
[Parameter (ValueFromPipelineByPropertyName = $True )][Alias (' Col' , ' ColStart' , ' ColumnStart' , ' StartCol' , ' StartColumn' )][UInt32 ]$Column ,
@@ -319,7 +318,7 @@ Function Write-Warning {
319
318
[Parameter (ValueFromPipelineByPropertyName = $True )][AllowEmptyString ()][AllowNull ()][String ]$Summary
320
319
)
321
320
Process {
322
- Write-Annotation - Type ' warning' - Message $Message - File $File - Line $Line - Column $Column - EndLine $EndLine - EndColumn $EndColumn - Title $Title - Summary $Summary
321
+ Write-Annotation - Type ' warning' - Data $Data - File $File - Line $Line - Column $Column - EndLine $EndLine - EndColumn $EndColumn - Title $Title - Summary $Summary
323
322
}
324
323
}
325
324
Set-Alias - Name ' Write-Warn' - Value ' Write-Warning' - Option ' ReadOnly' - Scope ' Local'
0 commit comments