mirror of
https://github.com/actions/download-artifact.git
synced 2025-07-26 16:38:28 +02:00
Improve logs
This commit is contained in:
parent
4dce5b5a43
commit
bdc1124b30
1 changed files with 19 additions and 4 deletions
|
@ -6,17 +6,32 @@ async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const name = core.getInput(Inputs.Name, {required: false})
|
const name = core.getInput(Inputs.Name, {required: false})
|
||||||
const path = core.getInput(Inputs.Path, {required: false})
|
const path = core.getInput(Inputs.Path, {required: false})
|
||||||
const artifactClient = artifact.create()
|
|
||||||
|
|
||||||
|
const artifactClient = artifact.create()
|
||||||
if (!name) {
|
if (!name) {
|
||||||
// download all artifacts
|
// download all artifacts
|
||||||
await artifactClient.downloadAllArtifacts(path)
|
const downloadResponse = await artifactClient.downloadAllArtifacts(path)
|
||||||
|
core.info(`There were ${downloadResponse.length} artifacts downloaded`)
|
||||||
|
for (const artifact of downloadResponse) {
|
||||||
|
core.info(
|
||||||
|
`Artifact ${artifact.artifactName} was downloaded to ${artifact.downloadPath}`
|
||||||
|
)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// download a single artifact
|
// download a single artifact
|
||||||
await artifactClient.downloadArtifact(name, path, {
|
const downloadOptions = {
|
||||||
createArtifactFolder: false
|
createArtifactFolder: false
|
||||||
})
|
}
|
||||||
|
const downloadResponse = await artifactClient.downloadArtifact(
|
||||||
|
name,
|
||||||
|
path,
|
||||||
|
downloadOptions
|
||||||
|
)
|
||||||
|
core.info(
|
||||||
|
`Artifact ${downloadResponse.artifactName} was downloaded to ${downloadResponse.downloadPath}`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
core.info('Artifact download has finished successfully')
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
core.setFailed(err.message)
|
core.setFailed(err.message)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue