mirror of
https://github.com/actions/download-artifact.git
synced 2024-11-22 21:55:29 +00:00
Fix extra root extra root directory if downloading single artifact on v4-beta
This commit is contained in:
parent
896d1bb258
commit
54ed8ca4ec
3105
dist/index.js
vendored
3105
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
@ -40,10 +40,11 @@ async function run(): Promise<void> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isSingleArtifactDownload = !!inputs.name
|
||||||
const artifactClient = artifact.create()
|
const artifactClient = artifact.create()
|
||||||
let artifacts: artifact.Artifact[] = []
|
let artifacts: artifact.Artifact[] = []
|
||||||
|
|
||||||
if (inputs.name) {
|
if (isSingleArtifactDownload) {
|
||||||
const {artifact: targetArtifact} = await artifactClient.getArtifact(
|
const {artifact: targetArtifact} = await artifactClient.getArtifact(
|
||||||
inputs.name,
|
inputs.name,
|
||||||
inputs.runID,
|
inputs.runID,
|
||||||
@ -81,7 +82,7 @@ async function run(): Promise<void> {
|
|||||||
|
|
||||||
const downloadPromises = artifacts.map(artifact =>
|
const downloadPromises = artifacts.map(artifact =>
|
||||||
artifactClient.downloadArtifact(artifact.id, owner, repo, inputs.token, {
|
artifactClient.downloadArtifact(artifact.id, owner, repo, inputs.token, {
|
||||||
path: path.join(resolvedPath, artifact.name)
|
path: isSingleArtifactDownload? resolvedPath : path.join(resolvedPath, inputs.name)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user