From bdc1124b30fce3a6650a6fc07afa2dcac488ea79 Mon Sep 17 00:00:00 2001 From: konradpabjan Date: Thu, 20 Feb 2020 22:41:17 -0500 Subject: [PATCH] Improve logs --- src/download-artifact.ts | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/download-artifact.ts b/src/download-artifact.ts index fa8e579..1721d2f 100644 --- a/src/download-artifact.ts +++ b/src/download-artifact.ts @@ -6,17 +6,32 @@ async function run(): Promise { try { const name = core.getInput(Inputs.Name, {required: false}) const path = core.getInput(Inputs.Path, {required: false}) - const artifactClient = artifact.create() + const artifactClient = artifact.create() if (!name) { // 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 { // download a single artifact - await artifactClient.downloadArtifact(name, path, { + const downloadOptions = { 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) { core.setFailed(err.message) }