Skip to content

Commit c1d5ec9

Browse files
committed
20230206A
1 parent 89a81bf commit c1d5ec9

File tree

18 files changed

+27146
-28295
lines changed

18 files changed

+27146
-28295
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ updates:
1515
separator: "/"
1616
rebase-strategy: "disabled"
1717
- package-ecosystem: "npm"
18-
directory: "/hugoalh.GitHubActionsToolkit/module/nodejs-wrapper"
18+
directory: "/nodejs-wrapper-source"
1919
schedule:
2020
interval: "daily"
2121
time: "00:00"

CONTRIBUTING.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,17 @@ This Contributing Guide includes the guidelines, methods, and ways to contribute
44

55
- those guidelines, methods, and/or ways are separated from this Contributing Guide and exist and/or store in their corresponding places,
66
- those categories, items, and/or types are easy to understand how to correctly contributing, or
7-
- maintainers and/or owners forgot to edit this Contributing Guide.
7+
- the maintainers and/or owners forgot to edit this Contributing Guide.
88

99
If you have any questions and/or still confused, try to create a discussion.
1010

1111
## Codes
1212

1313
All of the codes in this project and repository are follow the [hxhS (hugoalh & hugoalh Studio) Coding Guide](https://github.com/hugoalh/hugoalh/blob/main/coding-guide/main.md).
1414

15-
## Deploys, Releases, Tags & Versions
15+
## Deploys & Versions
1616

17-
These are always the works of:
18-
19-
- the maintainers who in this project and repository, and
20-
- the owner.
21-
22-
Which are follow the [hxhS (hugoalh & hugoalh Studio) Versioning Guide](https://github.com/hugoalh/hugoalh/blob/main/versioning-guide/main.md).
17+
These are always the works of the maintainers and/or owners, which are follow the [hxhS (hugoalh & hugoalh Studio) Versioning Guide](https://github.com/hugoalh/hugoalh/blob/main/versioning-guide/main.md).
2318

2419
## Discussions
2520

@@ -37,7 +32,7 @@ To improve the wiki, create an issue.
3732

3833
## I18ns (Internationalizations) & Translations
3934

40-
This project and repository does not have necessary things to do i18ns and/or translations.
35+
This project and repository does not need to do i18ns and/or translations.
4136

4237
If you want to do i18ns and/or translations on the documentations, documents and/or wiki, please see the section "[Documentations, Documents & Wiki](#documentations-documents--wiki)".
4338

@@ -55,4 +50,4 @@ If you want to do i18ns and/or translations on the documentations, documents and
5550
- Try to avoid a pull request with too many changes if possible.
5651
- A large pull request not only stretches the review time, but also makes it much harder to spot issues.
5752
- It is better to split the pull request to multiple smaller ones.
58-
- If your pull request is not ready but want to save it first, you can submit it by mark as draft, and no need to add any identifications to the title (e.g.: `[WIP]`).
53+
- If your pull request is not ready but want to save it first, you can submit it by mark as draft, and no need to add any identifications to the title (e.g.: `[WIP] XXXXXXXX`).

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
Copyright © 2021\~2022 hugoalh Studio
3+
Copyright © 2021\~2023 hugoalh Studio
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[`GitHubActionsToolkit.PowerShell`](https://github.com/hugoalh-studio/ghactions-toolkit-powershell)
44

5-
![PowerShell](https://img.shields.io/badge/PowerShell-0072C6?logo=powershell&logoColor=ffffff&style=flat-square "PowerShell")
65
![License](https://img.shields.io/static/v1?label=License&message=MIT&style=flat-square "License")
76
[![GitHub Stars](https://img.shields.io/github/stars/hugoalh-studio/ghactions-toolkit-powershell?label=Stars&logo=github&logoColor=ffffff&style=flat-square "GitHub Stars")](https://github.com/hugoalh-studio/ghactions-toolkit-powershell/stargazers)
87
[![GitHub Contributors](https://img.shields.io/github/contributors/hugoalh-studio/ghactions-toolkit-powershell?label=Contributors&logo=github&logoColor=ffffff&style=flat-square "GitHub Contributors")](https://github.com/hugoalh-studio/ghactions-toolkit-powershell/graphs/contributors)
@@ -22,7 +21,7 @@ A PowerShell module to provide a better and easier way for GitHub Actions to com
2221

2322
## 📚 Documentation (Excerpt)
2423

25-
For the full documentation, please visit [GitHub Repository Wiki](https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki).
24+
For the full documentation, please visit the [GitHub Repository Wiki](https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki).
2625

2726
### Getting Started
2827

hugoalh.GitHubActionsToolkit/LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
Copyright © 2021\~2022 hugoalh Studio
3+
Copyright © 2021\~2023 hugoalh Studio
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
CompanyName = 'hugoalh Studio'
1919

2020
# Copyright statement for this module
21-
Copyright = 'MIT © 2021~2022 hugoalh Studio'
21+
Copyright = 'MIT © 2021~2023 hugoalh Studio'
2222

2323
# Description of the functionality provided by this module
2424
Description = 'Provide a better and easier way for GitHub Actions to communicate with the runner machine, and the toolkit for developing GitHub Actions in PowerShell.'
@@ -249,7 +249,7 @@
249249
ReleaseNotes = '(Please visit https://github.com/hugoalh-studio/ghactions-toolkit-powershell/releases.)'
250250

251251
# Prerelease string of this module
252-
Prerelease = 'beta1'
252+
Prerelease = 'beta2'
253253

254254
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
255255
RequireLicenseAcceptance = $False

hugoalh.GitHubActionsToolkit/module/command-base.psm1

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,45 @@ Function Clear-FileCommand {
2727
[CmdletBinding(HelpUri = 'https://github.com/hugoalh-studio/ghactions-toolkit-powershell/wiki/api_function_clear-githubactionsfilecommand#Clear-GitHubActionsFileCommand')]
2828
[OutputType([Void])]
2929
Param (
30-
[Parameter(Mandatory = $True, Position = 0)][Alias('Types')][GitHubActionsFileCommandTypes]$Type
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
3136
)
32-
If (($Type -band [GitHubActionsFileCommandTypes]::EnvironmentVariable) -ieq [GitHubActionsFileCommandTypes]::EnvironmentVariable) {
37+
If (
38+
$EnvironmentVariable.IsPresent -or
39+
($Type -band [GitHubActionsFileCommandTypes]::EnvironmentVariable) -ieq [GitHubActionsFileCommandTypes]::EnvironmentVariable
40+
) {
3341
Remove-Item -LiteralPath $Env:GITHUB_ENV -Confirm:$False -ErrorAction 'Continue'
3442
}
35-
If (($Type -band [GitHubActionsFileCommandTypes]::Output) -ieq [GitHubActionsFileCommandTypes]::Output) {
43+
If (
44+
$Output.IsPresent -or
45+
($Type -band [GitHubActionsFileCommandTypes]::Output) -ieq [GitHubActionsFileCommandTypes]::Output
46+
) {
3647
Remove-Item -LiteralPath $Env:GITHUB_OUTPUT -Confirm:$False -ErrorAction 'Continue'
3748
}
38-
If (($Type -band [GitHubActionsFileCommandTypes]::Path) -ieq [GitHubActionsFileCommandTypes]::Path) {
49+
If (
50+
$Path.IsPresent -or
51+
($Type -band [GitHubActionsFileCommandTypes]::Path) -ieq [GitHubActionsFileCommandTypes]::Path
52+
) {
3953
Remove-Item -LiteralPath $Env:GITHUB_PATH -Confirm:$False -ErrorAction 'Continue'
4054
}
41-
If (($Type -band [GitHubActionsFileCommandTypes]::State) -ieq [GitHubActionsFileCommandTypes]::State) {
55+
If (
56+
$State.IsPresent -or
57+
($Type -band [GitHubActionsFileCommandTypes]::State) -ieq [GitHubActionsFileCommandTypes]::State
58+
) {
4259
Remove-Item -LiteralPath $Env:GITHUB_STATE -Confirm:$False -ErrorAction 'Continue'
4360
}
44-
If (($Type -band [GitHubActionsFileCommandTypes]::StepSummary) -ieq [GitHubActionsFileCommandTypes]::StepSummary) {
61+
If (
62+
$StepSummary.IsPresent -or
63+
($Type -band [GitHubActionsFileCommandTypes]::StepSummary) -ieq [GitHubActionsFileCommandTypes]::StepSummary
64+
) {
4565
Remove-Item -LiteralPath $Env:GITHUB_STEP_SUMMARY -Confirm:$False -ErrorAction 'Continue'
4666
}
4767
}
68+
Set-Alias -Name 'Clear-FileCommands' -Value 'Clear-FileCommand' -Option 'ReadOnly' -Scope 'Local'
4869
<#
4970
.SYNOPSIS
5071
GitHub Actions (Private) - Format Command Parameter Value
@@ -150,7 +171,7 @@ Function Write-FileCommand {
150171
Else {
151172
[String]$ItemRaw = "$Name=$Value" -ireplace '\r?\n', ''
152173
Do {
153-
[String]$Token = New-GitHubActionsRandomToken -Length 16
174+
[String]$Token = New-GitHubActionsRandomToken
154175
}
155176
While ( $ItemRaw -imatch [RegEx]::Escape($Token) )
156177
@(
@@ -166,4 +187,6 @@ Export-ModuleMember -Function @(
166187
'Clear-FileCommand',
167188
'Write-Command',
168189
'Write-FileCommand'
190+
) -Alias @(
191+
'Clear-FileCommands'
169192
)

hugoalh.GitHubActionsToolkit/module/command-control.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Function New-CommandsEndToken {
163163
[OutputType([String])]
164164
Param ()
165165
Do {
166-
[String]$Result = New-GitHubActionsRandomToken -Length 64
166+
[String]$Result = New-GitHubActionsRandomToken
167167
}
168168
While ( $Result -iin $GitHubActionsCommandsEndTokensUsed )
169169
$Script:GitHubActionsCommandsEndTokensUsed += $Result

hugoalh.GitHubActionsToolkit/module/environment-variable.psm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Function Add-PATH {
3434
[Parameter(ValueFromPipelineByPropertyName = $True)][Alias('Scopes')][GitHubActionsEnvironmentVariableScopes]$Scope = [GitHubActionsEnvironmentVariableScopes]3
3535
)
3636
Begin {
37-
[Boolean]$Legacy = [String]::IsNullOrWhiteSpace($Env:GITHUB_PATH)
37+
[Boolean]$UseLegacyMethod = [String]::IsNullOrWhiteSpace($Env:GITHUB_PATH)
3838
}
3939
Process {
4040
ForEach ($Item In (
@@ -49,7 +49,7 @@ Function Add-PATH {
4949
Add-Content -LiteralPath $Env:PATH -Value "$([System.IO.Path]::PathSeparator)$Item" -Confirm:$False -NoNewLine
5050
}
5151
If (($Scope -band [GitHubActionsEnvironmentVariableScopes]::Subsequent) -ieq [GitHubActionsEnvironmentVariableScopes]::Subsequent) {
52-
If ($Legacy) {
52+
If ($UseLegacyMethod) {
5353
Write-GitHubActionsCommand -Command 'add-path' -Value $Item
5454
}
5555
Else {
@@ -88,7 +88,7 @@ Function Set-EnvironmentVariable {
8888
[Parameter(ValueFromPipelineByPropertyName = $True)][Alias('Scopes')][GitHubActionsEnvironmentVariableScopes]$Scope = [GitHubActionsEnvironmentVariableScopes]3
8989
)
9090
Begin {
91-
[Boolean]$Legacy = [String]::IsNullOrWhiteSpace($Env:GITHUB_ENV)
91+
[Boolean]$UseLegacyMethod = [String]::IsNullOrWhiteSpace($Env:GITHUB_ENV)
9292
}
9393
Process {
9494
If ($PSCmdlet.ParameterSetName -ieq 'Multiple') {
@@ -109,7 +109,7 @@ Function Set-EnvironmentVariable {
109109
Out-Null
110110
}
111111
If (($Scope -band [GitHubActionsEnvironmentVariableScopes]::Subsequent) -ieq [GitHubActionsEnvironmentVariableScopes]::Subsequent) {
112-
If ($Legacy) {
112+
If ($UseLegacyMethod) {
113113
Write-GitHubActionsCommand -Command 'set-env' -Parameter @{ 'name' = $Name } -Value $Value
114114
}
115115
Else {

hugoalh.GitHubActionsToolkit/module/internal/token.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Function New-RandomToken {
1919
[CmdletBinding()]
2020
[OutputType([String])]
2121
Param (
22-
[Parameter(Position = 0)][ValidateRange(1, [UInt32]::MaxValue)][UInt32]$Length = 8,
22+
[Parameter(Position = 0)][ValidateRange(1, [UInt32]::MaxValue)][UInt32]$Length = 16,
2323
[Alias('UpperCase')][Switch]$WithUpperCase
2424
)
2525
[Char[]]$Pool = $PoolLowerCase + $PoolNumber + ($WithUpperCase.IsPresent ? $PoolUpperCase : @()) |

0 commit comments

Comments
 (0)