better fallback for path and append aritfact name for mutli-download

This commit is contained in:
Rob Herley 2023-08-24 12:05:05 -04:00
parent 24b1443a07
commit 727cfbe442
No known key found for this signature in database
GPG key ID: D1602042C3543B06
2 changed files with 9 additions and 2 deletions

View file

@ -22,6 +22,10 @@ async function run(): Promise<void> {
runID: parseInt(core.getInput(Inputs.RunID, {required: true}))
}
if (!inputs.path) {
inputs.path = process.env['GITHUB_WORKSPACE'] || process.cwd()
}
if (inputs.path.startsWith(`~`)) {
inputs.path = inputs.path.replace('~', os.homedir())
}
@ -77,7 +81,7 @@ async function run(): Promise<void> {
const downloadPromises = artifacts.map(artifact =>
artifactClient.downloadArtifact(artifact.id, owner, repo, inputs.token, {
path: resolvedPath
path: path.join(resolvedPath, artifact.name)
})
)