From 820a073cccb244fdeeb16eb752094fba36e4e5c7 Mon Sep 17 00:00:00 2001 From: leechechik Date: Wed, 29 Apr 2020 13:45:58 +0300 Subject: [PATCH] Send correct path(with name) to downloadArtifact function --- src/download-artifact.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/download-artifact.ts b/src/download-artifact.ts index 0730b6d..ccc1bfb 100644 --- a/src/download-artifact.ts +++ b/src/download-artifact.ts @@ -1,16 +1,17 @@ import * as core from '@actions/core' import * as artifact from '@actions/artifact' import {Inputs} from './constants' +import * as path from 'path' async function run(): Promise { try { const name = core.getInput(Inputs.Name, {required: false}) - const path = core.getInput(Inputs.Path, {required: false}) + const targetPath = core.getInput(Inputs.Path, {required: false}) const artifactClient = artifact.create() if (!name) { // download all artifacts - const downloadResponse = await artifactClient.downloadAllArtifacts(path) + const downloadResponse = await artifactClient.downloadAllArtifacts(targetPath) core.info(`There were ${downloadResponse.length} artifacts downloaded`) for (const artifact of downloadResponse) { core.info( @@ -20,11 +21,11 @@ async function run(): Promise { } else { // download a single artifact const downloadOptions = { - createArtifactFolder: true + createArtifactFolder: false } const downloadResponse = await artifactClient.downloadArtifact( name, - path, + path.join(targetPath, name), downloadOptions ) core.info(