Skip to content

Commit 6c1fbc9

Browse files
committed
20230207A
1 parent 661a5f3 commit 6c1fbc9

16 files changed

+53
-100
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ Import-Module -Name 'hugoalh.GitHubActionsToolkit' -Prefix 'GitHubActions' -Scop
6060
- `Add-GitHubActionsStepSummaryLink`
6161
- `Add-GitHubActionsStepSummarySubscriptText`
6262
- `Add-GitHubActionsStepSummarySuperscriptText`
63-
- `Clear-GitHubActionsFileCommand`
6463
- `Disable-GitHubActionsEchoingCommands`
6564
- `Disable-GitHubActionsProcessingCommands`
6665
- `Enable-GitHubActionsEchoingCommands`

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psd1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
'Add-StepSummaryRaw',
127127
'Add-StepSummarySubscript',
128128
'Add-StepSummarySuperscript',
129-
'Clear-FileCommands',
130129
'Disable-CommandEcho',
131130
'Disable-CommandEchoing',
132131
'Disable-CommandProcess',

hugoalh.GitHubActionsToolkit/module/artifact.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#Requires -Version 7.2
33
Import-Module -Name (
44
@(
5-
'nodejs-invoke.psm1',
6-
'utility.psm1'
5+
'nodejs-invoke',
6+
'utility'
77
) |
8-
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath $_ }
8+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
99
) -Prefix 'GitHubActions' -Scope 'Local'
1010
<#
1111
.SYNOPSIS

hugoalh.GitHubActionsToolkit/module/cache.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#Requires -Version 7.2
33
Import-Module -Name (
44
@(
5-
'nodejs-invoke.psm1',
6-
'utility.psm1'
5+
'nodejs-invoke',
6+
'utility'
77
) |
8-
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath $_ }
8+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
99
) -Prefix 'GitHubActions' -Scope 'Local'
1010
<#
1111
.SYNOPSIS

hugoalh.GitHubActionsToolkit/module/command-base.psm1

Lines changed: 7 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,10 @@
22
#Requires -Version 7.2
33
Import-Module -Name (
44
@(
5-
'internal\token.psm1'
5+
'internal\new-random-token'
66
) |
7-
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath $_ }
7+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
88
) -Prefix 'GitHubActions' -Scope 'Local'
9-
[Flags()] Enum GitHubActionsFileCommandTypes {
10-
EnvironmentVariable = 1
11-
Output = 2
12-
Path = 4
13-
State = 8
14-
StepSummary = 16
15-
}
169
<#
1710
.SYNOPSIS
1811
GitHub Actions - Clear File Command
@@ -23,52 +16,16 @@ Types of the file commands.
2316
.OUTPUTS
2417
[Void]
2518
#>
26-
Function Clear-FileCommand {
19+
Function Clear-FileCommand {# Deprecated, keep as legacy.
2720
[CmdletBinding(HelpUri = 'https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_clear-githubactionsfilecommand#Clear-GitHubActionsFileCommand')]
2821
[OutputType([Void])]
2922
Param (
30-
[Alias('Env', 'EnvironmentVariables', 'Var', 'Variable', 'Variables')][Switch]$EnvironmentVariable,
31-
[Alias('Outputs')][Switch]$Output,
32-
[Alias('Paths')][Switch]$Path,
33-
[Alias('States')][Switch]$State,
34-
[Alias('Summary')][Switch]$StepSummary,
35-
[Parameter(Position = 0)][Alias('Types')][GitHubActionsFileCommandTypes]$Type = 0# Deprecated, keep as legacy.
23+
[Parameter(Position = 0)][Alias('Types')]$Type
3624
)
37-
If (
38-
$EnvironmentVariable.IsPresent -or
39-
($Type -band [GitHubActionsFileCommandTypes]::EnvironmentVariable) -ieq [GitHubActionsFileCommandTypes]::EnvironmentVariable
40-
) {
41-
Remove-Item -LiteralPath $Env:GITHUB_ENV -Confirm:$False -ErrorAction 'Continue'
42-
}
43-
If (
44-
$Output.IsPresent -or
45-
($Type -band [GitHubActionsFileCommandTypes]::Output) -ieq [GitHubActionsFileCommandTypes]::Output
46-
) {
47-
Remove-Item -LiteralPath $Env:GITHUB_OUTPUT -Confirm:$False -ErrorAction 'Continue'
48-
}
49-
If (
50-
$Path.IsPresent -or
51-
($Type -band [GitHubActionsFileCommandTypes]::Path) -ieq [GitHubActionsFileCommandTypes]::Path
52-
) {
53-
Remove-Item -LiteralPath $Env:GITHUB_PATH -Confirm:$False -ErrorAction 'Continue'
54-
}
55-
If (
56-
$State.IsPresent -or
57-
($Type -band [GitHubActionsFileCommandTypes]::State) -ieq [GitHubActionsFileCommandTypes]::State
58-
) {
59-
Remove-Item -LiteralPath $Env:GITHUB_STATE -Confirm:$False -ErrorAction 'Continue'
60-
}
61-
If (
62-
$StepSummary.IsPresent -or
63-
($Type -band [GitHubActionsFileCommandTypes]::StepSummary) -ieq [GitHubActionsFileCommandTypes]::StepSummary
64-
) {
65-
Remove-Item -LiteralPath $Env:GITHUB_STEP_SUMMARY -Confirm:$False -ErrorAction 'Continue'
66-
}
6725
}
68-
Set-Alias -Name 'Clear-FileCommands' -Value 'Clear-FileCommand' -Option 'ReadOnly' -Scope 'Local'
6926
<#
7027
.SYNOPSIS
71-
GitHub Actions (Private) - Format Command Parameter Value
28+
GitHub Actions - Format Command Parameter Value
7229
.DESCRIPTION
7330
Format the command parameter value characters that can cause issues.
7431
.PARAMETER InputObject
@@ -90,7 +47,7 @@ Function Format-CommandParameterValue {
9047
Set-Alias -Name 'Format-CommandPropertyValue' -Value 'Format-CommandParameterValue' -Option 'ReadOnly' -Scope 'Local'
9148
<#
9249
.SYNOPSIS
93-
GitHub Actions (Private) - Format Command Value
50+
GitHub Actions - Format Command Value
9451
.DESCRIPTION
9552
Format the command value characters that can cause issues.
9653
.PARAMETER InputObject
@@ -144,7 +101,7 @@ Function Write-Command {
144101
}
145102
<#
146103
.SYNOPSIS
147-
GitHub Actions (Private) - Write File Command
104+
GitHub Actions - Write File Command
148105
.DESCRIPTION
149106
Write file command to communicate with the runner machine.
150107
.PARAMETER LiteralPath
@@ -187,6 +144,4 @@ Export-ModuleMember -Function @(
187144
'Clear-FileCommand',
188145
'Write-Command',
189146
'Write-FileCommand'
190-
) -Alias @(
191-
'Clear-FileCommands'
192147
)

hugoalh.GitHubActionsToolkit/module/command-control.psm1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
#Requires -Version 7.2
33
Import-Module -Name (
44
@(
5-
'command-base.psm1',
6-
'internal\token.psm1'
5+
'command-base',
6+
'internal\new-random-token'
77
) |
8-
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath $_ }
8+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
99
) -Prefix 'GitHubActions' -Scope 'Local'
1010
[String[]]$GitHubActionsCommands = @(
1111
'add-mask',
1212
'add-matcher',
13-
'add-path',# Legacy
13+
'add-path',# Legacy.
1414
'debug',
1515
'echo',
1616
'endgroup',
1717
'error',
1818
'group',
1919
'notice',
2020
'remove-matcher',
21-
'save-state',# Legacy
22-
'set-env',# Legacy
23-
'set-output',# Legacy
21+
'save-state',# Legacy.
22+
'set-env',# Legacy.
23+
'set-output',# Legacy.
2424
'stop-commands'
2525
'warning'
2626
)
@@ -152,7 +152,7 @@ Set-Alias -Name 'Start-ProcessingCommand' -Value 'Enable-ProcessingCommands' -Op
152152
Set-Alias -Name 'Start-ProcessingCommands' -Value 'Enable-ProcessingCommands' -Option 'ReadOnly' -Scope 'Local'
153153
<#
154154
.SYNOPSIS
155-
GitHub Actions (Private) - New Commands End Token
155+
GitHub Actions - New Commands End Token
156156
.DESCRIPTION
157157
Generate a new GitHub Actions commands end token.
158158
.OUTPUTS
@@ -171,7 +171,7 @@ Function New-CommandsEndToken {
171171
}
172172
<#
173173
.SYNOPSIS
174-
GitHub Actions (Private) - Test Processing Commands End Token
174+
GitHub Actions - Test Processing Commands End Token
175175
.DESCRIPTION
176176
Test the GitHub Actions processing commands end token whether is valid.
177177
.PARAMETER InputObject

hugoalh.GitHubActionsToolkit/module/environment-variable.psm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#Requires -Version 7.2
33
Import-Module -Name (
44
@(
5-
'command-base.psm1',
6-
'internal\test-parameter-input-object.psm1'
5+
'command-base',
6+
'internal\test-parameter-input-object'
77
) |
8-
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath $_ }
8+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
99
) -Prefix 'GitHubActions' -Scope 'Local'
1010
[Flags()] Enum GitHubActionsEnvironmentVariableScopes {
1111
Current = 1
@@ -122,7 +122,7 @@ Set-Alias -Name 'Set-Env' -Value 'Set-EnvironmentVariable' -Option 'ReadOnly' -S
122122
Set-Alias -Name 'Set-Environment' -Value 'Set-EnvironmentVariable' -Option 'ReadOnly' -Scope 'Local'
123123
<#
124124
.SYNOPSIS
125-
GitHub Actions (Private) - Test Environment Variable Name
125+
GitHub Actions - Test Environment Variable Name
126126
.DESCRIPTION
127127
Test the name of the environment variable whether is valid.
128128
.PARAMETER InputObject

hugoalh.GitHubActionsToolkit/module/log.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#Requires -Version 7.2
33
Import-Module -Name (
44
@(
5-
'command-base.psm1',
6-
'command-control.psm1'
5+
'command-base',
6+
'command-control'
77
) |
8-
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath $_ }
8+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
99
) -Prefix 'GitHubActions' -Scope 'Local'
1010
Enum GitHubActionsAnnotationType {
1111
Notice = 0

hugoalh.GitHubActionsToolkit/module/nodejs-invoke.psm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
#Requires -Version 7.2
33
Import-Module -Name (
44
@(
5-
'internal\token.psm1',
6-
'nodejs-test.psm1'
5+
'internal\new-random-token',
6+
'nodejs-test'
77
) |
8-
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath $_ }
8+
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
99
) -Prefix 'GitHubActions' -Scope 'Local'
1010
[String]$Wrapper = (Join-Path -Path $PSScriptRoot -ChildPath 'nodejs-wrapper' -AdditionalChildPath @('dist', 'main.js')) -ireplace '\\', '/'
1111
<#
1212
.SYNOPSIS
13-
GitHub Actions (Private) - Invoke NodeJS Wrapper
13+
GitHub Actions - Invoke NodeJS Wrapper
1414
.DESCRIPTION
1515
Invoke NodeJS wrapper.
1616
.PARAMETER Name

0 commit comments

Comments
 (0)