@@ -2328,9 +2328,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23282328Object.defineProperty(exports, "__esModule", ({ value: true }));
23292329exports.downloadArtifactInternal = exports.downloadArtifactPublic = exports.streamExtractExternal = void 0;
23302330const promises_1 = __importDefault(__nccwpck_require__(73292));
2331- const stream = __importStar(__nccwpck_require__(12781));
2332- const fs_1 = __nccwpck_require__(57147);
2333- const path = __importStar(__nccwpck_require__(71017));
23342331const github = __importStar(__nccwpck_require__(95438));
23352332const core = __importStar(__nccwpck_require__(42186));
23362333const httpClient = __importStar(__nccwpck_require__(96255));
@@ -2371,9 +2368,6 @@ function streamExtract(url, directory) {
23712368 return;
23722369 }
23732370 catch (error) {
2374- if (error.message.includes('Malformed extraction path')) {
2375- throw new Error(`Artifact download failed with unretryable error: ${error.message}`);
2376- }
23772371 retryCount++;
23782372 core.debug(`Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...`);
23792373 // wait 5 seconds before retrying
@@ -2396,8 +2390,6 @@ function streamExtractExternal(url, directory) {
23962390 response.message.destroy(new Error(`Blob storage chunk did not respond in ${timeout}ms`));
23972391 };
23982392 const timer = setTimeout(timerFn, timeout);
2399- const createdDirectories = new Set();
2400- createdDirectories.add(directory);
24012393 response.message
24022394 .on('data', () => {
24032395 timer.refresh();
@@ -2407,47 +2399,11 @@ function streamExtractExternal(url, directory) {
24072399 clearTimeout(timer);
24082400 reject(error);
24092401 })
2410- .pipe(unzip_stream_1.default.Parse())
2411- .pipe(new stream.Transform({
2412- objectMode: true,
2413- transform: (entry, _, callback) => __awaiter(this, void 0, void 0, function* () {
2414- const fullPath = path.normalize(path.join(directory, entry.path));
2415- if (!directory.endsWith(path.sep)) {
2416- directory += path.sep;
2417- }
2418- if (!fullPath.startsWith(directory)) {
2419- reject(new Error(`Malformed extraction path: ${fullPath}`));
2420- }
2421- if (entry.type === 'Directory') {
2422- if (!createdDirectories.has(fullPath)) {
2423- createdDirectories.add(fullPath);
2424- yield resolveOrCreateDirectory(fullPath).then(() => {
2425- entry.autodrain();
2426- callback();
2427- });
2428- }
2429- else {
2430- entry.autodrain();
2431- callback();
2432- }
2433- }
2434- else {
2435- core.info(`Extracting artifact entry: ${fullPath}`);
2436- if (!createdDirectories.has(path.dirname(fullPath))) {
2437- createdDirectories.add(path.dirname(fullPath));
2438- yield resolveOrCreateDirectory(path.dirname(fullPath));
2439- }
2440- const writeStream = (0, fs_1.createWriteStream)(fullPath);
2441- writeStream.on('finish', callback);
2442- writeStream.on('error', reject);
2443- entry.pipe(writeStream);
2444- }
2445- })
2446- }))
2447- .on('finish', () => __awaiter(this, void 0, void 0, function* () {
2402+ .pipe(unzip_stream_1.default.Extract({ path: directory }))
2403+ .on('close', () => {
24482404 clearTimeout(timer);
24492405 resolve();
2450- }))
2406+ })
24512407 .on('error', (error) => {
24522408 reject(error);
24532409 });
@@ -130415,7 +130371,7 @@ module.exports = index;
130415130371/***/ ((module) => {
130416130372
130417130373"use strict";
130418- module.exports = JSON.parse('{"name":"@actions/artifact","version":"2.1.6","preview":true,"description":"Actions artifact lib","keywords":["github","actions","artifact"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/artifact","license":"MIT","main":"lib/artifact.js","types":"lib/artifact.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/artifact"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"cd ../../ && npm run test ./packages/artifact","bootstrap":"cd ../../ && npm run bootstrap","tsc-run":"tsc","tsc":"npm run bootstrap && npm run tsc-run","gen:docs":"typedoc --plugin typedoc-plugin-markdown --out docs/generated src/artifact.ts --githubPages false --readme none"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.10.0","@actions/github":"^5.1.1","@actions/http-client":"^2.1.0","@azure/storage-blob":"^12.15.0","@octokit/core":"^3.5.1","@octokit/plugin-request-log":"^1.0.4","@octokit/plugin-retry":"^3.0.9","@octokit/request-error":"^5.0.0","@protobuf-ts/plugin":"^2.2.3-alpha.1","archiver":"^7.0.1","crypto":"^1.0.1","jwt-decode":"^3.1.2","twirp-ts":"^2.5.0","unzip-stream":"^0.3.1"},"devDependencies":{"@types/archiver":"^5.3.2","@types/unzip-stream":"^0.3.4","typedoc":"^0.25.4","typedoc-plugin-markdown":"^3.17.1","typescript":"^5.2.2"}}');
130374+ module.exports = JSON.parse('{"name":"@actions/artifact","version":"2.1.7","preview":true,"description":"Actions artifact lib","keywords":["github","actions","artifact"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/artifact","license":"MIT","main":"lib/artifact.js","types":"lib/artifact.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/artifact"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"cd ../../ && npm run test ./packages/artifact","bootstrap":"cd ../../ && npm run bootstrap","tsc-run":"tsc","tsc":"npm run bootstrap && npm run tsc-run","gen:docs":"typedoc --plugin typedoc-plugin-markdown --out docs/generated src/artifact.ts --githubPages false --readme none"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.10.0","@actions/github":"^5.1.1","@actions/http-client":"^2.1.0","@azure/storage-blob":"^12.15.0","@octokit/core":"^3.5.1","@octokit/plugin-request-log":"^1.0.4","@octokit/plugin-retry":"^3.0.9","@octokit/request-error":"^5.0.0","@protobuf-ts/plugin":"^2.2.3-alpha.1","archiver":"^7.0.1","crypto":"^1.0.1","jwt-decode":"^3.1.2","twirp-ts":"^2.5.0","unzip-stream":"^0.3.1"},"devDependencies":{"@types/archiver":"^5.3.2","@types/unzip-stream":"^0.3.4","typedoc":"^0.25.4","typedoc-plugin-markdown":"^3.17.1","typescript":"^5.2.2"}}');
130419130375
130420130376/***/ }),
130421130377
0 commit comments