22# Requires -Version 7.2
33Import-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
1811GitHub 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
7330Format the command parameter value characters that can cause issues.
7431. PARAMETER InputObject
@@ -90,7 +47,7 @@ Function Format-CommandParameterValue {
9047Set-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
9552Format 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
149106Write 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)
0 commit comments