Skip to content

Commit 78bdfa2

Browse files
committed
20220730A
1 parent e2209a7 commit 78bdfa2

File tree

11 files changed

+25
-43
lines changed

11 files changed

+25
-43
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ body:
1818
description: "What versions are affected? Versions must be listed as supported in the Security Policy (/.github/SECURITY.md)."
1919
multiple: true
2020
options:
21+
- "v0.5.3"
2122
- "v0.5.2"
2223
- "v0.5.1"
2324
- "v0.5.0"

.github/SECURITY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
1414
| **Tag / Version** | **Target** | **Support** |
1515
|:-:|:-:|:-:|
16-
| v0.X.X | PowerShell v7.2.0 ||
16+
| v0.5.X | PowerShell v7.2.0 ||
17+
| v0.5.0 \~ v0.5.2 | PowerShell v7.2.0 | 👎{🐛} |
1718
| v0.4.X | PowerShell v7.2.0 | 👎{🧓} |
1819
| v0.3.X | PowerShell v7.2.0 | 👎{🧓} |
1920
| v0.3.0 \~ v0.3.2 | PowerShell v7.2.0 | ❌{🐛🧓} |

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
RootModule = 'hugoalh.GitHubActionsToolkit.psm1'
44

55
# Version number of this module.
6-
ModuleVersion = '0.5.2'
6+
ModuleVersion = '0.5.3'
77

88
# Supported PSEditions
99
# CompatiblePSEditions = @()

hugoalh.GitHubActionsToolkit/module/artifact.psm1

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ Function Export-Artifact {
7272
If ($RetentionTime -igt 0) {
7373
$InputObject.RetentionTIme = $RetentionTime
7474
}
75-
$ResultRaw = Invoke-GitHubActionsNodeJsWrapper -Path 'artifact\upload.js' -InputObject ([PSCustomObject]$InputObject | ConvertTo-Json -Depth 100 -Compress)
76-
If ($Null -ieq $ResultRaw) {
77-
Return
78-
}
79-
Return ($ResultRaw | ConvertFrom-Json -Depth 100)
75+
Return (Invoke-GitHubActionsNodeJsWrapper -Path 'artifact\upload.js' -InputObject ([PSCustomObject]$InputObject | ConvertTo-Json -Depth 100 -Compress))
8076
}
8177
End {}
8278
}
@@ -121,24 +117,16 @@ Function Import-Artifact {
121117
}
122118
Switch ($PSCmdlet.ParameterSetName) {
123119
'All' {
124-
$ResultRaw = Invoke-GitHubActionsNodeJsWrapper -Path 'artifact\download-all.js' -InputObject ([PSCustomObject]@{
120+
Return (Invoke-GitHubActionsNodeJsWrapper -Path 'artifact\download-all.js' -InputObject ([PSCustomObject]@{
125121
Destination = $Destination
126-
} | ConvertTo-Json -Depth 100 -Compress)
127-
If ($Null -ieq $ResultRaw) {
128-
Return
129-
}
130-
Return ($ResultRaw | ConvertFrom-Json -Depth 100)
122+
} | ConvertTo-Json -Depth 100 -Compress))
131123
}
132124
'Single' {
133-
$ResultRaw = Invoke-GitHubActionsNodeJsWrapper -Path 'artifact\download.js' -InputObject ([PSCustomObject]@{
125+
Return (Invoke-GitHubActionsNodeJsWrapper -Path 'artifact\download.js' -InputObject ([PSCustomObject]@{
134126
Name = $Name
135127
Destination = $Destination
136128
CreateSubfolder = $CreateSubfolder.IsPresent
137-
} | ConvertTo-Json -Depth 100 -Compress)
138-
If ($Null -ieq $ResultRaw) {
139-
Return
140-
}
141-
Return ($ResultRaw | ConvertFrom-Json -Depth 100)
129+
} | ConvertTo-Json -Depth 100 -Compress))
142130
}
143131
}
144132
}

hugoalh.GitHubActionsToolkit/module/cache.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Function Restore-Cache {
7373
If ($Null -ieq $ResultRaw) {
7474
Return
7575
}
76-
Return ($ResultRaw | ConvertFrom-Json -Depth 100).CacheKey
76+
Return $ResultRaw.CacheKey
7777
}
7878
End {}
7979
}
@@ -133,7 +133,7 @@ Function Save-Cache {
133133
If ($Null -ieq $ResultRaw) {
134134
Return
135135
}
136-
Return ($ResultRaw | ConvertFrom-Json -Depth 100).CacheId
136+
Return $ResultRaw.CacheId
137137
}
138138
End {}
139139
}

hugoalh.GitHubActionsToolkit/module/nodejs-invoke.psm1

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,19 @@ Function Invoke-NodeJsWrapper {
3737
Try {
3838
[String[]]$Result = Invoke-Expression -Command "node --no-deprecation --no-warnings `"$($WrapperFullName -ireplace '\\', '/')`" `"$($InputObject | ConvertTo-Json -Depth 100 -Compress)`" `"$ResultSeparator`""
3939
[UInt32]$ResultSkipIndex = @()
40-
For ($ResultIndex = 0; $ResultIndex -lt $Result.Count; $ResultIndex++) {
40+
For ([UInt32]$ResultIndex = 0; $ResultIndex -lt $Result.Count; $ResultIndex++) {
4141
[String]$Item = $Result[$ResultIndex]
42-
If (
43-
$Item -imatch '^::debug' -or
44-
$Item -imatch '^::error' -or
45-
$Item -imatch '^::notice' -or
46-
$Item -imatch '^::warning'
47-
) {
42+
If ($Item -imatch '^::.+$') {
4843
Write-Host -Object $Item
4944
$ResultSkipIndex += $ResultIndex
5045
}
5146
}
52-
If ($LASTEXITCODE -ine 0) {
47+
If ($LASTEXITCODE -igt 0) {
5348
Throw "Unexpected exit code ``$LASTEXITCODE``! $(($Result | Select-Object -SkipIndex $ResultSkipIndex) -join "`n")"
5449
}
5550
Return ($Result[($Result.IndexOf($ResultSeparator) + 1)..($Result.Count - 1)] -join "`n" | ConvertFrom-Json -Depth 100)
5651
} Catch {
57-
Write-Error -Message "Unable to successfully execute NodeJS wrapper ``$Path``! $_" -Category 'InvalidData'
52+
Write-Error -Message "Unable to successfully invoke NodeJS wrapper ``$Path``! $_" -Category 'InvalidData'
5853
Return
5954
}
6055
}

hugoalh.GitHubActionsToolkit/module/nodejs-wrapper/artifact/download.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/usr/bin/env node
22
import { create as ghactionsArtifact } from "@actions/artifact";
33
const input = JSON.parse(process.argv[2]);
4-
const result = await ghactionsArtifact().downloadArtifact(input.Name, input.Destination, {
5-
createArtifactFolder: input.CreateSubfolder
6-
}).catch((reason) => {
4+
const result = await ghactionsArtifact().downloadArtifact(input.Name, input.Destination, { createArtifactFolder: input.CreateSubfolder }).catch((reason) => {
75
console.error(reason);
86
return process.exit(1);
97
});

hugoalh.GitHubActionsToolkit/module/nodejs-wrapper/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hugoalh.GitHubActionsToolkit/module/nodejs-wrapper/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hugoalh/ghactions-toolkit-powershell-nodejs-wrapper",
3-
"version": "0.5.2",
3+
"version": "0.5.3",
44
"description": "A PowerShell module to provide a better and easier way for GitHub Actions to communicate with the runner machine, and the toolkit for developing GitHub Actions in PowerShell.",
55
"keywords": [
66
"gh-actions",

hugoalh.GitHubActionsToolkit/module/open-id-connect.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Function Get-OpenIdConnectToken {
4444
If ($Null -ieq $ResultRaw) {
4545
Return
4646
}
47-
Return ($ResultRaw | ConvertFrom-Json -Depth 100).Token
47+
Return $ResultRaw.Token
4848
}
4949
[String]$RequestToken = $Env:ACTIONS_ID_TOKEN_REQUEST_TOKEN
5050
[String]$RequestUri = $Env:ACTIONS_ID_TOKEN_REQUEST_URL

0 commit comments

Comments
 (0)