@@ -2999,6 +2999,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
2999
2999
Object.defineProperty(exports, "__esModule", ({ value: true }));
3000
3000
exports.getUploadChunkTimeout = exports.getConcurrency = exports.getGitHubWorkspaceDir = exports.isGhes = exports.getResultsServiceUrl = exports.getRuntimeToken = exports.getUploadChunkSize = void 0;
3001
3001
const os_1 = __importDefault(__nccwpck_require__(22037));
3002
+ const core_1 = __nccwpck_require__(42186);
3002
3003
// Used for controlling the highWaterMark value of the zip that is being streamed
3003
3004
// The same value is used as the chunk size that is use during upload to blob storage
3004
3005
function getUploadChunkSize() {
@@ -3041,17 +3042,38 @@ exports.getGitHubWorkspaceDir = getGitHubWorkspaceDir;
3041
3042
// Mimics behavior of azcopy: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-optimize
3042
3043
// If your machine has fewer than 5 CPUs, then the value of this variable is set to 32.
3043
3044
// Otherwise, the default value is equal to 16 multiplied by the number of CPUs. The maximum value of this variable is 300.
3045
+ // This value can be lowered with ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY variable.
3044
3046
function getConcurrency() {
3045
3047
const numCPUs = os_1.default.cpus().length;
3046
- if (numCPUs <= 4) {
3047
- return 32;
3048
+ let concurrencyCap = 32;
3049
+ if (numCPUs > 4) {
3050
+ const concurrency = 16 * numCPUs;
3051
+ concurrencyCap = concurrency > 300 ? 300 : concurrency;
3052
+ }
3053
+ const concurrencyOverride = process.env['ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY'];
3054
+ if (concurrencyOverride) {
3055
+ const concurrency = parseInt(concurrencyOverride);
3056
+ if (isNaN(concurrency) || concurrency < 1) {
3057
+ throw new Error('Invalid value set for ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY env variable');
3058
+ }
3059
+ if (concurrency < concurrencyCap) {
3060
+ return concurrency;
3061
+ }
3062
+ (0, core_1.info)(`ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY is higher than the cap of ${concurrencyCap} based on the number of cpus. Lowering it to the cap.`);
3048
3063
}
3049
- const concurrency = 16 * numCPUs;
3050
- return concurrency > 300 ? 300 : concurrency;
3064
+ return concurrencyCap;
3051
3065
}
3052
3066
exports.getConcurrency = getConcurrency;
3053
3067
function getUploadChunkTimeout() {
3054
- return 300000; // 5 minutes
3068
+ const timeoutVar = process.env['ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS'];
3069
+ if (!timeoutVar) {
3070
+ return 300000; // 5 minutes
3071
+ }
3072
+ const timeout = parseInt(timeoutVar);
3073
+ if (isNaN(timeout)) {
3074
+ throw new Error('Invalid value set for ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS env variable');
3075
+ }
3076
+ return timeout;
3055
3077
}
3056
3078
exports.getUploadChunkTimeout = getUploadChunkTimeout;
3057
3079
//# sourceMappingURL=config.js.map
@@ -137606,7 +137628,7 @@ module.exports = index;
137606
137628
/***/ ((module) => {
137607
137629
137608
137630
"use strict";
137609
- module.exports = JSON.parse('{"name":"@actions/artifact","version":"2.2.0","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","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"}}');
137631
+ module.exports = JSON.parse('{"name":"@actions/artifact","version":"2.2.1","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","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"}}');
137610
137632
137611
137633
/***/ }),
137612
137634
0 commit comments