Skip to content

Commit d4dd134

Browse files
committed
20220624B
1 parent 8a483c9 commit d4dd134

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psd1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@
153153
'Get-WebhookEvent',
154154
'Get-WebhookPayload',
155155
'Get-WorkflowRunUrl',
156+
'Restore-Artifact',
156157
'Restore-State',
158+
'Save-Artifact',
157159
'Save-State',
158160
'Set-Env',
159161
'Set-Environment',

hugoalh.GitHubActionsToolkit/module/artifact.psm1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Function Export-Artifact {
128128
Return [PSCustomObject]$Result
129129
}
130130
}
131+
Set-Alias -Name 'Save-Artifact' -Value 'Export-Artifact' -Option 'ReadOnly' -Scope 'Local'
131132
<#
132133
.SYNOPSIS
133134
GitHub Actions - Import Artifact
@@ -149,9 +150,9 @@ Function Import-Artifact {
149150
[OutputType([PSCustomObject[]])]
150151
Param (
151152
[Parameter(Mandatory = $True, ParameterSetName = 'Select', Position = 0, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)][String[]]$Name,
152-
[String]$Destination = $Env:GITHUB_WORKSPACE,
153153
[Parameter(ParameterSetName = 'Select')][Switch]$CreateSubfolder,
154-
[Parameter(Mandatory = $True, ParameterSetName = 'All')][Switch]$All
154+
[Parameter(Mandatory = $True, ParameterSetName = 'All')][Switch]$All,
155+
[String]$Destination = $Env:GITHUB_WORKSPACE
155156
)
156157
Begin {
157158
If (!(Test-GitHubActionsEnvironment -Artifact)) {
@@ -190,6 +191,7 @@ Function Import-Artifact {
190191
Return $OutputObject
191192
}
192193
}
194+
Set-Alias -Name 'Restore-Artifact' -Value 'Import-Artifact' -Option 'ReadOnly' -Scope 'Local'
193195
<#
194196
.SYNOPSIS
195197
GitHub Actions (Internal) - Test Artifact Name
@@ -229,4 +231,7 @@ Function Test-ArtifactPath {
229231
Export-ModuleMember -Function @(
230232
'Export-Artifact',
231233
'Import-Artifact'
234+
) -Alias @(
235+
'Restore-Artifact',
236+
'Save-Artifact'
232237
)

hugoalh.GitHubActionsToolkit/module/nodejs-wrapper/cache/save.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22
import { saveCache as ghactionsCacheSaveCache } from "@actions/cache";
33
const input = JSON.parse(process.argv[2]);
4-
const result = await ghactionsCacheSaveCache(input.Paths, input.Key, {
4+
const result = await ghactionsCacheSaveCache(input.Path, input.Key, {
55
uploadChunkSize: input.UploadChunkSizes,
66
uploadConcurrency: input.UploadConcurrency
77
}).catch((reason) => {

hugoalh.GitHubActionsToolkit/module/parameter.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ Function Get-Input {
3737
[Parameter(Mandatory = $True, ParameterSetName = 'One', Position = 0, ValueFromPipeline = $True)][ValidatePattern('^(?:[\da-z][\da-z_-]*)?[\da-z]$', ErrorMessage = '`{0}` is not a valid GitHub Actions input name!')][Alias('Key')][String]$Name,
3838
[Parameter(ParameterSetName = 'One')][Alias('Require', 'Required')][Switch]$Mandatory,
3939
[Parameter(ParameterSetName = 'One')][Alias('RequiredMessage', 'RequireMessage')][String]$MandatoryMessage = 'Input `{0}` is not defined!',
40+
[Parameter(Mandatory = $True, ParameterSetName = 'All')][Switch]$All,
4041
[Parameter(Mandatory = $True, ParameterSetName = 'Prefix')][ValidatePattern('^[\da-z][\da-z_-]*$', ErrorMessage = '`{0}` is not a valid GitHub Actions input name prefix!')][Alias('KeyPrefix', 'KeyStartWith', 'NameStartWith', 'Prefix', 'PrefixKey', 'PrefixName', 'StartWith', 'StartWithKey', 'StartWithName')][String]$NamePrefix,
4142
[Parameter(Mandatory = $True, ParameterSetName = 'Suffix')][ValidatePattern('^[\da-z_-]*[\da-z]$', ErrorMessage = '`{0}` is not a valid GitHub Actions input name suffix!')][Alias('EndWith', 'EndWithKey', 'EndWithName', 'KeyEndWith', 'KeySuffix', 'NameEndWith', 'Suffix', 'SuffixKey', 'SuffixName')][String]$NameSuffix,
42-
[Parameter(Mandatory = $True, ParameterSetName = 'All')][Switch]$All,
4343
[Alias('AssumeEmptyStringAsNull')][Switch]$EmptyStringAsNull,
4444
[Switch]$Trim
4545
)
@@ -139,9 +139,9 @@ Function Get-State {
139139
[OutputType([Hashtable], ParameterSetName = ('All', 'Prefix', 'Suffix'))]
140140
Param (
141141
[Parameter(Mandatory = $True, ParameterSetName = 'One', Position = 0, ValueFromPipeline = $True)][ValidatePattern('^(?:[\da-z][\da-z_-]*)?[\da-z]$', ErrorMessage = '`{0}` is not a valid GitHub Actions state name!')][Alias('Key')][String]$Name,
142+
[Parameter(Mandatory = $True, ParameterSetName = 'All')][Switch]$All,
142143
[Parameter(Mandatory = $True, ParameterSetName = 'Prefix')][ValidatePattern('^[\da-z][\da-z_-]*$', ErrorMessage = '`{0}` is not a valid GitHub Actions state name prefix!')][Alias('KeyPrefix', 'KeyStartWith', 'NameStartWith', 'Prefix', 'PrefixKey', 'PrefixName', 'StartWith', 'StartWithKey', 'StartWithName')][String]$NamePrefix,
143144
[Parameter(Mandatory = $True, ParameterSetName = 'Suffix')][ValidatePattern('^[\da-z_-]*[\da-z]$', ErrorMessage = '`{0}` is not a valid GitHub Actions state name suffix!')][Alias('EndWith', 'EndWithKey', 'EndWithName', 'KeyEndWith', 'KeySuffix', 'NameEndWith', 'Suffix', 'SuffixKey', 'SuffixName')][String]$NameSuffix,
144-
[Parameter(Mandatory = $True, ParameterSetName = 'All')][Switch]$All,
145145
[Alias('AssumeEmptyStringAsNull')][Switch]$EmptyStringAsNull,
146146
[Switch]$Trim
147147
)

0 commit comments

Comments
 (0)