From c7de68f215739283dfe53c20e607871e86c5d822 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 28 Mar 2024 17:48:56 +0000 Subject: [PATCH] updating resolves --- packages/artifact/src/internal/upload/zip.ts | 27 +++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/artifact/src/internal/upload/zip.ts b/packages/artifact/src/internal/upload/zip.ts index 7c69fc78..d022822a 100644 --- a/packages/artifact/src/internal/upload/zip.ts +++ b/packages/artifact/src/internal/upload/zip.ts @@ -1,5 +1,4 @@ import * as stream from 'stream' -import * as async from 'async' import * as ZipStream from 'zip-stream' import * as core from '@actions/core' import {createReadStream} from 'fs' @@ -60,18 +59,21 @@ export async function createZipUploadStream( }) }) - const bufferSize = getUploadChunkSize() - const zipUploadStream = new ZipUploadStream(bufferSize) - core.debug( - `Zip write high watermark value ${zipUploadStream.writableHighWaterMark}` - ) - core.debug( - `Zip read high watermark value ${zipUploadStream.readableHighWaterMark}` - ) - await Promise.all(uploadFilePromises) + await Promise.all(uploadFilePromises).then(result => { + core.debug(`Zip result is ${result}`) + zip.finalize() + const bufferSize = getUploadChunkSize() + const zipUploadStream = new ZipUploadStream(bufferSize) + core.debug( + `Zip write high watermark value ${zipUploadStream.writableHighWaterMark}` + ) + core.debug( + `Zip read high watermark value ${zipUploadStream.readableHighWaterMark}` + ) + return zipUploadStream + }) + throw new Error('An error has occurred during zip creation for the artifact') // zip.pipe(zipUploadStream) - zip.finalize() - return zipUploadStream } // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -81,6 +83,7 @@ const zipErrorCallback = (error: any): void => { throw new Error('An error has occurred during zip creation for the artifact') } +// eslint-disable-next-line @typescript-eslint/no-explicit-any const zipWarningCallback = (err: any): void => { if (err.code === 'ENOENT') { core.warning(