@@ -2328,9 +2328,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
2328
2328
Object.defineProperty(exports, "__esModule", ({ value: true }));
2329
2329
exports.downloadArtifactInternal = exports.downloadArtifactPublic = exports.streamExtractExternal = void 0;
2330
2330
const 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));
2334
2331
const github = __importStar(__nccwpck_require__(95438));
2335
2332
const core = __importStar(__nccwpck_require__(42186));
2336
2333
const httpClient = __importStar(__nccwpck_require__(96255));
@@ -2371,9 +2368,6 @@ function streamExtract(url, directory) {
2371
2368
return;
2372
2369
}
2373
2370
catch (error) {
2374
- if (error.message.includes('Malformed extraction path')) {
2375
- throw new Error(`Artifact download failed with unretryable error: ${error.message}`);
2376
- }
2377
2371
retryCount++;
2378
2372
core.debug(`Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...`);
2379
2373
// wait 5 seconds before retrying
@@ -2396,8 +2390,6 @@ function streamExtractExternal(url, directory) {
2396
2390
response.message.destroy(new Error(`Blob storage chunk did not respond in ${timeout}ms`));
2397
2391
};
2398
2392
const timer = setTimeout(timerFn, timeout);
2399
- const createdDirectories = new Set();
2400
- createdDirectories.add(directory);
2401
2393
response.message
2402
2394
.on('data', () => {
2403
2395
timer.refresh();
@@ -2407,47 +2399,11 @@ function streamExtractExternal(url, directory) {
2407
2399
clearTimeout(timer);
2408
2400
reject(error);
2409
2401
})
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', () => {
2448
2404
clearTimeout(timer);
2449
2405
resolve();
2450
- }))
2406
+ })
2451
2407
.on('error', (error) => {
2452
2408
reject(error);
2453
2409
});
@@ -130415,7 +130371,7 @@ module.exports = index;
130415
130371
/***/ ((module) => {
130416
130372
130417
130373
"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"}}');
130419
130375
130420
130376
/***/ }),
130421
130377
0 commit comments