diff --git a/dist/index.js b/dist/index.js index e6c7b68..ac87892 100644 --- a/dist/index.js +++ b/dist/index.js @@ -31181,10 +31181,7 @@ function doDownload(s3, s3Bucket, fileKey, localKey) { core.debug(`S3 download uri: s3://${s3Bucket}/${fileKey}`); const readStream = s3.getObject(getObjectParams).createReadStream(); readStream.pipe(writeStream); - readStream.on('close', () => { - core.info(`Finished download: ${localKey}`); - resolve; - }); + readStream.on('close', resolve); readStream.on('error', reject); }); } @@ -31221,7 +31218,9 @@ function run() { continue; } const localKey = path_1.default.join(resolvedPath, fileObject.Key.replace(s3Prefix, '')); - yield doDownload(s3, s3Bucket, fileObject.Key, localKey); + yield doDownload(s3, s3Bucket, fileObject.Key, localKey).then(() => { + core.info(`Finished download: ${localKey}`); + }); } // output the directory that the artifact(s) was/were downloaded to // if no path is provided, an empty string resolves to the current working directory diff --git a/package.json b/package.json index ed79b1f..b7caf73 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "dist/index.js", "scripts": { "build": "tsc", - "release": "ncc build src/download-artifact.ts && git add -f dist/", + "release": "ncc build src/download-artifact.ts", "check-all": "concurrently \"npm:format-check\" \"npm:lint\" \"npm:build\"", "format": "prettier --write **/*.ts", "format-check": "prettier --check **/*.ts", diff --git a/src/download-artifact.ts b/src/download-artifact.ts index 535638c..c8034d8 100644 --- a/src/download-artifact.ts +++ b/src/download-artifact.ts @@ -24,10 +24,7 @@ function doDownload( core.debug(`S3 download uri: s3://${s3Bucket}/${fileKey}`) const readStream = s3.getObject(getObjectParams).createReadStream() readStream.pipe(writeStream) - readStream.on('close', () => { - core.info(`Finished download: ${localKey}`) - resolve - }) + readStream.on('close', resolve) readStream.on('error', reject) }) } @@ -67,7 +64,9 @@ async function run(): Promise { resolvedPath, fileObject.Key.replace(s3Prefix, '') ) - await doDownload(s3, s3Bucket, fileObject.Key, localKey) + await doDownload(s3, s3Bucket, fileObject.Key, localKey).then(() => { + core.info(`Finished download: ${localKey}`) + }) } // output the directory that the artifact(s) was/were downloaded to // if no path is provided, an empty string resolves to the current working directory