Merge pull request #2842 from github/henrymercer/zip64

Raise the file limit for debug artifacts by producing zip64 files where necessary
This commit is contained in:
Andrew Eisenberg 2025-04-07 10:50:46 -07:00 committed by GitHub
commit bb59df6c17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 447 additions and 3978 deletions

View file

@ -4,7 +4,7 @@ import * as path from "path";
import * as artifact from "@actions/artifact";
import * as artifactLegacy from "@actions/artifact-legacy";
import * as core from "@actions/core";
import AdmZip from "adm-zip";
import archiver from "archiver";
import del from "del";
import { getOptionalInput, getTemporaryDirectory } from "./actions-util";
@ -344,9 +344,24 @@ async function createPartialDatabaseBundle(
if (fs.existsSync(databaseBundlePath)) {
await del(databaseBundlePath, { force: true });
}
const zip = new AdmZip();
zip.addLocalFolder(databasePath);
zip.writeZip(databaseBundlePath);
const output = fs.createWriteStream(databaseBundlePath);
const zip = archiver("zip");
zip.on("error", (err) => {
throw err;
});
zip.on("warning", (err) => {
// Ignore ENOENT warnings. There's nothing anyone can do about it.
if (err.code !== "ENOENT") {
throw err;
}
});
zip.pipe(output);
zip.directory(databasePath, false);
await zip.finalize();
return databaseBundlePath;
}