Skip to content

Commit e3f5b0a

Browse files
committed
20220106A
1 parent 1ffae17 commit e3f5b0a

File tree

2 files changed

+75
-18
lines changed

2 files changed

+75
-18
lines changed

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psd1

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@
6565
'Add-GHActionsPATH',
6666
'Add-GHActionsProblemMatcher',
6767
'Add-GHActionsSecretMask',
68-
'Disable-GHActionsCommandEcho',
68+
'Disable-GHActionsEchoCommand',
6969
'Disable-GHActionsProcessingCommand',
70-
'Enable-GHActionsCommandEcho',
70+
'Enable-GHActionsEchoCommand',
7171
'Enable-GHActionsProcessingCommand',
7272
'Enter-GHActionsLogGroup',
7373
'Exit-GHActionsLogGroup',
@@ -93,7 +93,21 @@
9393
VariablesToExport = '*'
9494

9595
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
96-
AliasesToExport = @()
96+
AliasesToExport = @(
97+
'Add-GHActionsEnv',
98+
'Add-GHActionsMask',
99+
'Add-GHActionsSecret',
100+
'Disable-GHActionsCommandEcho',
101+
'Disable-GHActionsCommandProcessing',
102+
'Enable-GHActionsCommandEcho',
103+
'Enable-GHActionsCommandProcessing',
104+
'Enter-GHActionsGroup',
105+
'Exit-GHActionsGroup',
106+
'Get-GHActionsEvent',
107+
'Get-GHActionsPayload',
108+
'Write-GHActionsNote',
109+
'Write-GHActionsWarn'
110+
)
97111

98112
# DSC resources to export from this module
99113
# DscResourcesToExport = @()
@@ -112,6 +126,8 @@
112126
'action',
113127
'actions',
114128
'github',
129+
'github-action',
130+
'github-actions',
115131
'PSEdition_Core',
116132
'toolkit'
117133
)

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psm1

Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ function Add-GHActionsEnvironmentVariable {
150150
}) -join "`n")" -Encoding utf8NoBOM
151151
}
152152
}
153+
Set-Alias -Name 'Add-GHActionsEnv' -Value 'Add-GHActionsEnvironmentVariable' -Option ReadOnly -Scope 'Local'
153154
<#
154155
.SYNOPSIS
155156
GitHub Actions - Add PATH
@@ -219,19 +220,22 @@ function Add-GHActionsSecretMask {
219220
}
220221
end {}
221222
}
223+
Set-Alias -Name 'Add-GHActionsMask' -Value 'Add-GHActionsSecretMask' -Option ReadOnly -Scope 'Local'
224+
Set-Alias -Name 'Add-GHActionsSecret' -Value 'Add-GHActionsSecretMask' -Option ReadOnly -Scope 'Local'
222225
<#
223226
.SYNOPSIS
224-
GitHub Actions - Disable Command Echo
227+
GitHub Actions - Disable Echo Command
225228
.DESCRIPTION
226229
Disable echoing of workflow commands, the workflow run's log will not show the command itself; A workflow command is echoed if there are any errors processing the command; Secret `ACTIONS_STEP_DEBUG` will ignore this.
227230
.OUTPUTS
228231
Void
229232
#>
230-
function Disable-GHActionsCommandEcho {
233+
function Disable-GHActionsEchoCommand {
231234
[CmdletBinding()][OutputType([void])]
232235
param()
233236
Write-GHActionsCommand -Command 'echo' -Message 'off'
234237
}
238+
Set-Alias -Name 'Disable-GHActionsCommandEcho' -Value 'Disable-GHActionsEchoCommand' -Option ReadOnly -Scope 'Local'
235239
<#
236240
.SYNOPSIS
237241
GitHub Actions - Disable Processing Command
@@ -248,19 +252,21 @@ function Disable-GHActionsProcessingCommand {
248252
Write-GHActionsCommand -Command 'stop-commands' -Message $EndToken
249253
return $EndToken
250254
}
255+
Set-Alias -Name 'Disable-GHActionsCommandProcessing' -Value 'Disable-GHActionsProcessingCommand' -Option ReadOnly -Scope 'Local'
251256
<#
252257
.SYNOPSIS
253-
GitHub Actions - Enable Command Echo
258+
GitHub Actions - Enable Echo Command
254259
.DESCRIPTION
255260
Enable echoing of workflow commands, the workflow run's log will show the command itself; The `add-mask`, `debug`, `warning`, and `error` commands do not support echoing because their outputs are already echoed to the log; Secret `ACTIONS_STEP_DEBUG` will ignore this.
256261
.OUTPUTS
257262
Void
258263
#>
259-
function Enable-GHActionsCommandEcho {
264+
function Enable-GHActionsEchoCommand {
260265
[CmdletBinding()][OutputType([void])]
261266
param()
262267
Write-GHActionsCommand -Command 'echo' -Message 'on'
263268
}
269+
Set-Alias -Name 'Enable-GHActionsCommandEcho' -Value 'Enable-GHActionsEchoCommand' -Option ReadOnly -Scope 'Local'
264270
<#
265271
.SYNOPSIS
266272
GitHub Actions - Enable Processing Command
@@ -278,6 +284,7 @@ function Enable-GHActionsProcessingCommand {
278284
)
279285
Write-GHActionsCommand -Command $EndToken -Message ''
280286
}
287+
Set-Alias -Name 'Enable-GHActionsCommandProcessing' -Value 'Enable-GHActionsProcessingCommand' -Option ReadOnly -Scope 'Local'
281288
<#
282289
.SYNOPSIS
283290
GitHub Actions - Enter Log Group
@@ -295,6 +302,7 @@ function Enter-GHActionsLogGroup {
295302
)
296303
Write-GHActionsCommand -Command 'group' -Message $Title
297304
}
305+
Set-Alias -Name 'Enter-GHActionsGroup' -Value 'Enter-GHActionsLogGroup' -Option ReadOnly -Scope 'Local'
298306
<#
299307
.SYNOPSIS
300308
GitHub Actions - Exit Log Group
@@ -308,6 +316,7 @@ function Exit-GHActionsLogGroup {
308316
param ()
309317
Write-GHActionsCommand -Command 'endgroup' -Message ''
310318
}
319+
Set-Alias -Name 'Exit-GHActionsGroup' -Value 'Exit-GHActionsLogGroup' -Option ReadOnly -Scope 'Local'
311320
<#
312321
.SYNOPSIS
313322
GitHub Actions - Get Input
@@ -431,6 +440,8 @@ function Get-GHActionsWebhookEventPayload {
431440
)
432441
return (Get-Content -Path $env:GITHUB_EVENT_PATH -Raw -Encoding utf8NoBOM | ConvertFrom-Json -AsHashtable:$AsHashTable)
433442
}
443+
Set-Alias -Name 'Get-GHActionsEvent' -Value 'Get-GHActionsWebhookEventPayload' -Option ReadOnly -Scope 'Local'
444+
Set-Alias -Name 'Get-GHActionsPayload' -Value 'Get-GHActionsWebhookEventPayload' -Option ReadOnly -Scope 'Local'
434445
function Remove-GHActionsProblemMatcher {
435446
[CmdletBinding()][OutputType([void])]
436447
param (
@@ -445,16 +456,6 @@ function Remove-GHActionsProblemMatcher {
445456
end {}
446457
}
447458
<#
448-
function Save-GHActionsCache {
449-
[CmdletBinding()][OutputType([void])]
450-
param (
451-
[Parameter(Mandatory = $true, Position = 0)][ValidateLength(1,512)][ValidatePattern('^[\da-z._-]+$')][string]$Key,
452-
[Parameter(Mandatory = $true, Position = 1, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)][SupportsWildcards()][string[]]
453-
$Path
454-
)
455-
}
456-
#>
457-
<#
458459
.SYNOPSIS
459460
GitHub Actions - Set Output
460461
.DESCRIPTION
@@ -660,6 +661,7 @@ function Write-GHActionsNotice {
660661
)
661662
Write-GHActionsAnnotation -Type 'Notice' -Message $Message -File $File -Line $Line -Col $Col -EndLine $EndLine -EndColumn $EndColumn -Title $Title
662663
}
664+
Set-Alias -Name 'Write-GHActionsNote' -Value 'Write-GHActionsNotice' -Option ReadOnly -Scope 'Local'
663665
<#
664666
.SYNOPSIS
665667
GitHub Actions - Write Warning
@@ -695,4 +697,43 @@ function Write-GHActionsWarning {
695697
)
696698
Write-GHActionsAnnotation -Type 'Warning' -Message $Message -File $File -Line $Line -Col $Col -EndLine $EndLine -EndColumn $EndColumn -Title $Title
697699
}
698-
Export-ModuleMember -Function Add-GHActionsEnvironmentVariable, Add-GHActionsPATH, Add-GHActionsProblemMatcher, Add-GHActionsSecretMask, Disable-GHActionsCommandEcho, Disable-GHActionsProcessingCommand, Enable-GHActionsCommandEcho, Enable-GHActionsProcessingCommand, Enter-GHActionsLogGroup, Exit-GHActionsLogGroup, Get-GHActionsInput, Get-GHActionsIsDebug, Get-GHActionsState, Get-GHActionsWebhookEventPayload, Remove-GHActionsProblemMatcher, Set-GHActionsOutput, Set-GHActionsState, Write-GHActionsAnnotation, Write-GHActionsDebug, Write-GHActionsError, Write-GHActionsFail, Write-GHActionsNotice, Write-GHActionsWarning
700+
Set-Alias -Name 'Write-GHActionsWarn' -Value 'Write-GHActionsWarning' -Option ReadOnly -Scope 'Local'
701+
Export-ModuleMember -Function @(
702+
'Add-GHActionsEnvironmentVariable',
703+
'Add-GHActionsPATH',
704+
'Add-GHActionsProblemMatcher',
705+
'Add-GHActionsSecretMask',
706+
'Disable-GHActionsEchoCommand',
707+
'Disable-GHActionsProcessingCommand',
708+
'Enable-GHActionsEchoCommand',
709+
'Enable-GHActionsProcessingCommand',
710+
'Enter-GHActionsLogGroup',
711+
'Exit-GHActionsLogGroup',
712+
'Get-GHActionsInput',
713+
'Get-GHActionsIsDebug',
714+
'Get-GHActionsState',
715+
'Get-GHActionsWebhookEventPayload',
716+
'Remove-GHActionsProblemMatcher',
717+
'Set-GHActionsOutput',
718+
'Set-GHActionsState',
719+
'Write-GHActionsAnnotation',
720+
'Write-GHActionsDebug',
721+
'Write-GHActionsError',
722+
'Write-GHActionsFail',
723+
'Write-GHActionsNotice',
724+
'Write-GHActionsWarning'
725+
) -Alias @(
726+
'Add-GHActionsEnv',
727+
'Add-GHActionsMask',
728+
'Add-GHActionsSecret',
729+
'Disable-GHActionsCommandEcho',
730+
'Disable-GHActionsCommandProcessing',
731+
'Enable-GHActionsCommandEcho',
732+
'Enable-GHActionsCommandProcessing',
733+
'Enter-GHActionsGroup',
734+
'Exit-GHActionsGroup',
735+
'Get-GHActionsEvent',
736+
'Get-GHActionsPayload',
737+
'Write-GHActionsNote',
738+
'Write-GHActionsWarn'
739+
)

0 commit comments

Comments
 (0)