From 9517cdf52d6a6b4e5a700aca60aec5c46fc38ad4 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Tue, 23 Jul 2024 17:55:45 +0700 Subject: [PATCH 1/2] Prevent "too many open files" in artifact upload See https://www.archiverjs.com/docs/archiver/#file --- packages/artifact/src/internal/upload/zip.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/artifact/src/internal/upload/zip.ts b/packages/artifact/src/internal/upload/zip.ts index 5a923119..4b9c43bf 100644 --- a/packages/artifact/src/internal/upload/zip.ts +++ b/packages/artifact/src/internal/upload/zip.ts @@ -44,7 +44,7 @@ export async function createZipUploadStream( for (const file of uploadSpecification) { if (file.sourcePath !== null) { // Add a normal file to the zip - zip.append(createReadStream(file.sourcePath), { + zip.file(file.sourcePath, { name: file.destinationPath }) } else { From 7c610546492fdb7df9e5dc2cde430f839c5abcf7 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Sat, 27 Jul 2024 17:00:02 +0700 Subject: [PATCH 2/2] Remove unused import --- packages/artifact/src/internal/upload/zip.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/artifact/src/internal/upload/zip.ts b/packages/artifact/src/internal/upload/zip.ts index 4b9c43bf..10433fb8 100644 --- a/packages/artifact/src/internal/upload/zip.ts +++ b/packages/artifact/src/internal/upload/zip.ts @@ -1,7 +1,6 @@ import * as stream from 'stream' import * as archiver from 'archiver' import * as core from '@actions/core' -import {createReadStream} from 'fs' import {UploadZipSpecification} from './upload-zip-specification' import {getUploadChunkSize} from '../shared/config'