Skip to content

Commit 63477af

Browse files
committed
Another fix of NodeJS wrapper
1 parent 21568a4 commit 63477af

File tree

10 files changed

+24
-23
lines changed

10 files changed

+24
-23
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 (file: `SECURITY.md`)."
1919
multiple: true
2020
options:
21+
- "v1.3.2-beta.1"
2122
- "v1.3.1"
2223
- "v1.3.0"
2324
- "v1.2.3"

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| **Versions** | **Status** | **Target - PowerShell** | **Target - NodeJS (Wrapper API)** | **Target - NPM (Wrapper API)** |
1515
|:-:|:-:|:-:|:-:|:-:|
1616
| v1.3.X | L | >= v7.2.0 | >= v14.15.0 | *N/A* |
17-
| v1.3.0 | 👎{🐛} | >= v7.2.0 | >= v14.15.0 | *N/A* |
17+
| v1.3.0 \~ v1.3.1 | 👎{🐛} | >= v7.2.0 | >= v14.15.0 | *N/A* |
1818
| v1.2.X | 👎{🐛} | >= v7.2.0 | >= v14.15.0 | *N/A* |
1919
| v1.1.X | 👎{🐛} | >= v7.2.0 | >= v14.15.0 | >= v6.14.8 |
2020
| v1.1.0 | ❌{🐛} | >= v7.2.0 | >= v14.15.0 | >= v6.14.8 |

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psd1

Lines changed: 2 additions & 2 deletions
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 = '1.3.1'
6+
ModuleVersion = '1.3.2'
77

88
# Supported PSEditions
99
# CompatiblePSEditions = @()
@@ -250,7 +250,7 @@
250250
ReleaseNotes = '(Please visit https://github.com/hugoalh-studio/ghactions-toolkit-powershell/releases.)'
251251

252252
# Prerelease string of this module
253-
# Prerelease = ''
253+
Prerelease = 'beta1'
254254

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

hugoalh.GitHubActionsToolkit/module/artifact.psm1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Function Export-Artifact {
7878
If ($RetentionTime -igt 0) {
7979
$InputObject.RetentionTIme = $RetentionTime
8080
}
81-
Invoke-GitHubActionsNodeJsWrapper -Name 'artifact/upload' -InputObject ([PSCustomObject]$InputObject) |
81+
Invoke-GitHubActionsNodeJsWrapper -Name 'artifact/upload' -InputObject $InputObject |
8282
Write-Output
8383
}
8484
}
@@ -126,17 +126,17 @@ Function Import-Artifact {
126126
#>
127127
Switch ($PSCmdlet.ParameterSetName) {
128128
'All' {
129-
Invoke-GitHubActionsNodeJsWrapper -Name 'artifact/download-all' -InputObject ([PSCustomObject]@{
129+
Invoke-GitHubActionsNodeJsWrapper -Name 'artifact/download-all' -InputObject @{
130130
Destination = $Destination
131-
}) |
131+
} |
132132
Write-Output
133133
}
134134
'Single' {
135-
Invoke-GitHubActionsNodeJsWrapper -Name 'artifact/download' -InputObject ([PSCustomObject]@{
135+
Invoke-GitHubActionsNodeJsWrapper -Name 'artifact/download' -InputObject @{
136136
Name = $Name
137137
Destination = $Destination
138138
CreateSubfolder = $CreateSubfolder.IsPresent
139-
}) |
139+
} |
140140
Write-Output
141141
}
142142
}

hugoalh.GitHubActionsToolkit/module/cache.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Function Restore-Cache {
8181
If ($Timeout -igt 0) {
8282
$InputObject.Timeout = $Timeout * 1000
8383
}
84-
(Invoke-GitHubActionsNodeJsWrapper -Name 'cache/restore' -InputObject ([PSCustomObject]$InputObject))?.CacheKey |
84+
(Invoke-GitHubActionsNodeJsWrapper -Name 'cache/restore' -InputObject $InputObject)?.CacheKey |
8585
Write-Output
8686
}
8787
}
@@ -141,7 +141,7 @@ Function Save-Cache {
141141
If ($UploadConcurrency -igt 0) {
142142
$InputObject.UploadConcurrency = $UploadConcurrency
143143
}
144-
(Invoke-GitHubActionsNodeJsWrapper -Name 'cache/save' -InputObject ([PSCustomObject]$InputObject))?.CacheId |
144+
(Invoke-GitHubActionsNodeJsWrapper -Name 'cache/save' -InputObject $InputObject)?.CacheId |
145145
Write-Output
146146
}
147147
}

hugoalh.GitHubActionsToolkit/module/nodejs-invoke.psm1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Import-Module -Name (
77
) |
88
ForEach-Object -Process { Join-Path -Path $PSScriptRoot -ChildPath "$_.psm1" }
99
) -Prefix 'GitHubActions' -Scope 'Local'
10-
[String]$Wrapper = (Join-Path -Path $PSScriptRoot -ChildPath 'nodejs-wrapper' -AdditionalChildPath @('dist', 'main.js')) -ireplace '\\', '/'
10+
[String]$WrapperPath = Join-Path -Path $PSScriptRoot -ChildPath 'nodejs-wrapper' -AdditionalChildPath @('dist', 'main.js')
1111
<#
1212
.SYNOPSIS
1313
GitHub Actions - Invoke NodeJS Wrapper
@@ -26,22 +26,22 @@ Function Invoke-NodeJsWrapper {
2626
[OutputType(([PSCustomObject], [PSCustomObject[]]))]
2727
Param (
2828
[Parameter(Mandatory = $True, Position = 0)][String]$Name,
29-
[Parameter(Mandatory = $True, Position = 1)][Alias('Argument', 'Arguments', 'Input', 'Object', 'Parameter', 'Parameters')][PSCustomObject]$InputObject
29+
[Parameter(Mandatory = $True, Position = 1)][Alias('Argument', 'Arguments', 'Input', 'Object', 'Parameter', 'Parameters')][Hashtable]$InputObject
3030
)
3131
If (!(Test-GitHubActionsNodeJsEnvironment)) {
3232
Write-Error -Message 'This function requires to invoke with the compatible NodeJS environment!' -Category 'ResourceUnavailable'
3333
Return
3434
}
35-
If (!(Test-Path -LiteralPath $Wrapper -PathType 'Leaf')) {
35+
If (!(Test-Path -LiteralPath $WrapperPath -PathType 'Leaf')) {
3636
Write-Error -Message 'Wrapper is missing!' -Category 'ResourceUnavailable'
3737
Return
3838
}
3939
[String]$ResultSeparator = "=====$(New-GitHubActionsRandomToken -Length 32)====="
4040
Try {
41-
[String[]]$Result = node --no-deprecation --no-warnings "$Wrapper" "$Name" "$(
41+
[String[]]$Result = Invoke-Expression -Command "node --no-deprecation --no-warnings `"$WrapperPath`" `"$Name`" `"$(
4242
$InputObject |
4343
ConvertTo-Json -Depth 100 -Compress
44-
)" "$ResultSeparator"
44+
)`" `"$ResultSeparator`""
4545
[UInt32]$ResultSkipIndex = @()
4646
For ([UInt32]$ResultIndex = 0; $ResultIndex -ilt $Result.Count; $ResultIndex++) {
4747
[String]$Item = $Result[$ResultIndex]

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-distribution",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
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
@@ -43,7 +43,7 @@ Function Get-OpenIdConnectToken {
4343
If ($Audience.Length -igt 0) {
4444
$InputObject.Audience = $Audience
4545
}
46-
(Invoke-GitHubActionsNodeJsWrapper -Name 'open-id-connect/get-token' -InputObject ([PSCustomObject]$InputObject))?.Token |
46+
(Invoke-GitHubActionsNodeJsWrapper -Name 'open-id-connect/get-token' -InputObject $InputObject)?.Token |
4747
Write-Output
4848
}
4949
}

hugoalh.GitHubActionsToolkit/module/tool-cache.psm1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Function Expand-ToolCacheCompressedFile {
9191
If ($Flag.Length -igt 0) {
9292
$InputObject.Flag = $Flag
9393
}
94-
(Invoke-GitHubActionsNodeJsWrapper -Name "tool-cache/extract-$($Method.ToLower())" -InputObject ([PSCustomObject]$InputObject))?.Path |
94+
(Invoke-GitHubActionsNodeJsWrapper -Name "tool-cache/extract-$($Method.ToLower())" -InputObject $InputObject)?.Path |
9595
Write-Output
9696
}
9797
}
@@ -148,7 +148,7 @@ Function Find-ToolCache {
148148
If ($Architecture.Length -igt 0) {
149149
$InputObject.Architecture = $Architecture
150150
}
151-
$ResultRaw = Invoke-GitHubActionsNodeJsWrapper -Name "tool-cache/find$($IsFindAll ? '-all-versions' : '')" -InputObject ([PSCustomObject]$InputObject)
151+
$ResultRaw = Invoke-GitHubActionsNodeJsWrapper -Name "tool-cache/find$($IsFindAll ? '-all-versions' : '')" -InputObject $InputObject
152152
Write-Output -InputObject ($IsFindAll ? ${ResultRaw}?.Paths : ${ResultRaw}?.Path)
153153
}
154154
}
@@ -203,7 +203,7 @@ Function Invoke-ToolCacheToolDownloader {
203203
If ($Header.Count -igt 0) {
204204
$InputObject.Header = [PSCustomObject]$Header
205205
}
206-
(Invoke-GitHubActionsNodeJsWrapper -Name 'tool-cache/download-tool' -InputObject ([PSCustomObject]$InputObject))?.Path |
206+
(Invoke-GitHubActionsNodeJsWrapper -Name 'tool-cache/download-tool' -InputObject $InputObject)?.Path |
207207
Write-Output
208208
}
209209
}
@@ -254,7 +254,7 @@ Function Register-ToolCacheDirectory {
254254
If ($Architecture.Length -igt 0) {
255255
$InputObject.Architecture = $Architecture
256256
}
257-
(Invoke-GitHubActionsNodeJsWrapper -Name 'tool-cache/cache-directory' -InputObject ([PSCustomObject]$InputObject))?.Path |
257+
(Invoke-GitHubActionsNodeJsWrapper -Name 'tool-cache/cache-directory' -InputObject $InputObject)?.Path |
258258
Write-Output
259259
}
260260
}
@@ -309,7 +309,7 @@ Function Register-ToolCacheFile {
309309
If ($Architecture.Length -igt 0) {
310310
$InputObject.Architecture = $Architecture
311311
}
312-
(Invoke-GitHubActionsNodeJsWrapper -Name 'tool-cache/cache-file' -InputObject ([PSCustomObject]$InputObject))?.Path |
312+
(Invoke-GitHubActionsNodeJsWrapper -Name 'tool-cache/cache-file' -InputObject $InputObject)?.Path |
313313
Write-Output
314314
}
315315
}

nodejs-wrapper-source/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-source",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
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",

0 commit comments

Comments
 (0)