From 17c4cab8b265b0202b4dce39232ac5d968383210 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 28 Mar 2024 19:16:10 +0000 Subject: [PATCH] adding constant zlib compression level --- packages/artifact/src/internal/upload/zip.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/upload/zip.ts b/packages/artifact/src/internal/upload/zip.ts index 8bcc09c2..97ea57e7 100644 --- a/packages/artifact/src/internal/upload/zip.ts +++ b/packages/artifact/src/internal/upload/zip.ts @@ -1,6 +1,7 @@ import * as stream from 'stream' import * as ZipStream from 'zip-stream' import * as core from '@actions/core' +import * as zlib from 'zlib' import {createReadStream} from 'fs' import {UploadZipSpecification} from './upload-zip-specification' import {getUploadChunkSize} from '../shared/config' @@ -30,7 +31,10 @@ export async function createZipUploadStream( `Creating Artifact archive with compressionLevel: ${compressionLevel}` ) const zlibOptions = { - zlib: {level: DEFAULT_COMPRESSION_LEVEL, bufferSize: getUploadChunkSize()} + zlib: { + level: zlib.constants.Z_DEFAULT_COMPRESSION, + bufferSize: getUploadChunkSize() + } } const zip = new ZipStream.default(zlibOptions) // register callbacks for various events during the zip lifecycle