Merge pull request #821 from actions/tunc-d-upload-artifact-package-bump

Bump @actions/artifact to 6.3.1
This commit is contained in:
tunc-d
2026-10-07 09:24:16 +02:00
committed by GitHub
7 changed files with 140 additions and 127 deletions

View File

@@ -1,9 +1,9 @@
--- ---
name: "@actions/artifact" name: "@actions/artifact"
version: 6.2.0 version: 6.3.1
type: npm type: npm
summary: Actions artifact lib summary:
homepage: https://github.com/actions/toolkit/tree/main/packages/artifact homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE.md - sources: LICENSE.md

View File

@@ -1,9 +1,9 @@
--- ---
name: "@actions/core" name: "@actions/core"
version: 3.0.0 version: 3.0.1
type: npm type: npm
summary: Actions core lib summary:
homepage: https://github.com/actions/toolkit/tree/main/packages/core homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE.md - sources: LICENSE.md

View File

@@ -1,9 +1,9 @@
--- ---
name: "@actions/github" name: "@actions/github"
version: 9.0.0 version: 9.1.1
type: npm type: npm
summary: Actions github lib summary:
homepage: https://github.com/actions/toolkit/tree/main/packages/github homepage:
license: mit license: mit
licenses: licenses:
- sources: LICENSE.md - sources: LICENSE.md

61
dist/merge/index.js vendored
View File

@@ -79219,7 +79219,7 @@ module.exports = index;
/***/ 2822: /***/ 2822:
/***/ ((module) => { /***/ ((module) => {
module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/artifact","version":"6.2.0","preview":true,"description":"Actions artifact lib","keywords":["github","actions","artifact"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/artifact","license":"MIT","type":"module","main":"lib/artifact.js","types":"lib/artifact.d.ts","exports":{".":{"types":"./lib/artifact.d.ts","import":"./lib/artifact.js"}},"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 && cp src/internal/shared/package-version.cjs lib/internal/shared/","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":"^3.0.0","@actions/github":"^9.0.0","@actions/http-client":"^4.0.0","@azure/storage-blob":"^12.30.0","@octokit/core":"^7.0.6","@octokit/plugin-request-log":"^6.0.0","@octokit/plugin-retry":"^8.0.0","@octokit/request":"^10.0.7","@octokit/request-error":"^7.1.0","@protobuf-ts/plugin":"^2.2.3-alpha.1","@protobuf-ts/runtime":"^2.9.4","archiver":"^7.0.1","jwt-decode":"^4.0.0","unzip-stream":"^0.3.1"},"devDependencies":{"@types/archiver":"^7.0.0","@types/unzip-stream":"^0.3.4","typedoc":"^0.28.16","typedoc-plugin-markdown":"^4.9.0","typescript":"^5.9.3"},"overrides":{"uri-js":"npm:uri-js-replace@^1.0.1","node-fetch":"^3.3.2"}}'); module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/artifact","version":"6.3.1","preview":true,"description":"Actions artifact lib","keywords":["github","actions","artifact"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/artifact","license":"MIT","type":"module","main":"lib/artifact.js","types":"lib/artifact.d.ts","exports":{".":{"types":"./lib/artifact.d.ts","import":"./lib/artifact.js"}},"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 && cp src/internal/shared/package-version.cjs lib/internal/shared/","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":"^3.0.1","@actions/github":"^9.1.1","@actions/http-client":"^4.0.1","@azure/storage-blob":"^12.31.0","@octokit/core":"^7.0.6","@octokit/plugin-request-log":"^6.0.0","@octokit/plugin-retry":"^8.1.0","@octokit/request":"^10.0.8","@octokit/request-error":"^7.1.0","@protobuf-ts/runtime":"^2.11.1","@protobuf-ts/runtime-rpc":"^2.11.1","archiver":"^7.0.1","jwt-decode":"^4.0.0","unzip-stream":"^0.3.1"},"devDependencies":{"@protobuf-ts/plugin":"^2.11.1","@types/archiver":"^7.0.0","@types/unzip-stream":"^0.3.4","typedoc":"^0.28.19","typedoc-plugin-markdown":"^4.11.0","typescript":"^5.9.3"},"overrides":{"uri-js":"npm:uri-js-replace@^1.0.1","node-fetch":"^3.3.2"}}');
/***/ }) /***/ })
@@ -86690,7 +86690,7 @@ NetworkError.isNetworkErrorCode = (code) => {
}; };
class UsageError extends Error { class UsageError extends Error {
constructor() { constructor() {
const message = `Artifact storage quota has been hit. Unable to upload any new artifacts. Usage is recalculated every 6-12 hours.\nMore info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`; const message = `Artifact storage quota has been hit. Unable to upload any new artifacts.\nMore info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`;
super(message); super(message);
this.name = 'UsageError'; this.name = 'UsageError';
} }
@@ -86900,8 +86900,9 @@ var artifact_twirp_client_awaiter = (undefined && undefined.__awaiter) || functi
class ArtifactHttpClient { class ArtifactHttpClient {
constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) {
this.maxAttempts = 5; this.maxAttempts = 5;
this.baseRetryIntervalMilliseconds = 3000; this.baseRetryIntervalMilliseconds = 8000;
this.retryMultiplier = 1.5; this.retryMultiplier = 1.5;
this.retryTimeoutMilliseconds = 120000;
const token = getRuntimeToken(); const token = getRuntimeToken();
this.baseUrl = getResultsServiceUrl(); this.baseUrl = getResultsServiceUrl();
if (maxAttempts) { if (maxAttempts) {
@@ -86940,11 +86941,16 @@ class ArtifactHttpClient {
let attempt = 0; let attempt = 0;
let errorMessage = ''; let errorMessage = '';
let rawBody = ''; let rawBody = '';
let totalRetryWaitMilliseconds = 0;
while (attempt < this.maxAttempts) { while (attempt < this.maxAttempts) {
let isRetryable = false; let isRetryable = false;
let retryAfterSeconds;
try { try {
const response = yield operation(); const response = yield operation();
const statusCode = response.message.statusCode; const statusCode = response.message.statusCode;
if (statusCode === HttpCodes.TooManyRequests) {
retryAfterSeconds = this.getRetryAfterSeconds(response);
}
rawBody = yield response.readBody(); rawBody = yield response.readBody();
core_debug(`[Response] - ${response.message.statusCode}`); core_debug(`[Response] - ${response.message.statusCode}`);
core_debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`); core_debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`);
@@ -86982,9 +86988,16 @@ class ArtifactHttpClient {
if (attempt + 1 === this.maxAttempts) { if (attempt + 1 === this.maxAttempts) {
throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${errorMessage}`); throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${errorMessage}`);
} }
const retryTimeMilliseconds = this.getExponentialRetryTimeMilliseconds(attempt); const retryTimeMilliseconds = retryAfterSeconds !== undefined
? retryAfterSeconds * 1000
: this.getExponentialRetryTimeMilliseconds(attempt);
if (totalRetryWaitMilliseconds + retryTimeMilliseconds >
this.retryTimeoutMilliseconds) {
throw new Error(`Retry wait of ${retryTimeMilliseconds} ms would exceed the maximum total retry wait of ${this.retryTimeoutMilliseconds} ms: ${errorMessage}`);
}
info(`Attempt ${attempt + 1} of ${this.maxAttempts} failed with error: ${errorMessage}. Retrying request in ${retryTimeMilliseconds} ms...`); info(`Attempt ${attempt + 1} of ${this.maxAttempts} failed with error: ${errorMessage}. Retrying request in ${retryTimeMilliseconds} ms...`);
yield this.sleep(retryTimeMilliseconds); yield this.sleep(retryTimeMilliseconds);
totalRetryWaitMilliseconds += retryTimeMilliseconds;
attempt++; attempt++;
} }
throw new Error(`Request failed`); throw new Error(`Request failed`);
@@ -87007,6 +87020,17 @@ class ArtifactHttpClient {
]; ];
return retryableStatusCodes.includes(statusCode); return retryableStatusCodes.includes(statusCode);
} }
// Only positive integer seconds are supported, not HTTP-date values.
getRetryAfterSeconds(response) {
var _a;
const header = response.message.headers['retry-after'];
const value = (_a = (Array.isArray(header) ? header[0] : header)) === null || _a === void 0 ? void 0 : _a.trim();
if (value === undefined || !/^\d+$/.test(value)) {
return undefined;
}
const parsed = parseInt(value, 10);
return !isNaN(parsed) && parsed > 0 ? parsed : undefined;
}
sleep(milliseconds) { sleep(milliseconds) {
return artifact_twirp_client_awaiter(this, void 0, void 0, function* () { return artifact_twirp_client_awaiter(this, void 0, void 0, function* () {
return new Promise(resolve => setTimeout(resolve, milliseconds)); return new Promise(resolve => setTimeout(resolve, milliseconds));
@@ -126828,6 +126852,19 @@ function getProxyFetch(destinationUrl) {
function getApiBaseUrl() { function getApiBaseUrl() {
return process.env['GITHUB_API_URL'] || 'https://api.github.com'; return process.env['GITHUB_API_URL'] || 'https://api.github.com';
} }
function getUserAgentWithOrchestrationId(baseUserAgent) {
var _a;
const orchId = (_a = process.env['ACTIONS_ORCHESTRATION_ID']) === null || _a === void 0 ? void 0 : _a.trim();
if (orchId) {
const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
const tag = `actions_orchestration_id/${sanitizedId}`;
if (baseUserAgent === null || baseUserAgent === void 0 ? void 0 : baseUserAgent.includes(tag))
return baseUserAgent;
const ua = baseUserAgent ? `${baseUserAgent} ` : '';
return `${ua}${tag}`;
}
return baseUserAgent;
}
//# sourceMappingURL=utils.js.map //# sourceMappingURL=utils.js.map
;// CONCATENATED MODULE: ./node_modules/universal-user-agent/index.js ;// CONCATENATED MODULE: ./node_modules/universal-user-agent/index.js
function getUserAgent() { function getUserAgent() {
@@ -130924,6 +130961,7 @@ const utils_defaults = {
} }
}; };
const GitHub = Octokit.plugin(restEndpointMethods, paginateRest).defaults(utils_defaults); const GitHub = Octokit.plugin(restEndpointMethods, paginateRest).defaults(utils_defaults);
/** /**
* Convience function to correctly format Octokit Options to pass into the constructor. * Convience function to correctly format Octokit Options to pass into the constructor.
* *
@@ -130937,6 +130975,11 @@ function getOctokitOptions(token, options) {
if (auth) { if (auth) {
opts.auth = auth; opts.auth = auth;
} }
// Orchestration ID
const userAgent = getUserAgentWithOrchestrationId(opts.userAgent);
if (userAgent) {
opts.userAgent = userAgent;
}
return opts; return opts;
} }
//# sourceMappingURL=utils.js.map //# sourceMappingURL=utils.js.map
@@ -131038,13 +131081,17 @@ function streamExtractExternal(url_1, directory_1) {
mimeType === 'application/zip-compressed' || mimeType === 'application/zip-compressed' ||
urlEndsWithZip; urlEndsWithZip;
// Extract filename from Content-Disposition header // Extract filename from Content-Disposition header
// Prefer filename* (RFC 5987) which supports UTF-8 encoded filenames,
// fall back to filename which may contain ASCII-only replacements
const contentDisposition = response.message.headers['content-disposition'] || ''; const contentDisposition = response.message.headers['content-disposition'] || '';
let fileName = 'artifact'; let fileName = 'artifact';
const filenameMatch = contentDisposition.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?/i); const filenameStar = contentDisposition.match(/filename\*\s*=\s*UTF-8''([^;\r\n]*)/i);
if (filenameMatch && filenameMatch[1]) { const filenamePlain = contentDisposition.match(/(?<!\*)filename\s*=\s*['"]?([^;\r\n"']*)['"]?/i);
const rawName = (filenameStar === null || filenameStar === void 0 ? void 0 : filenameStar[1]) || (filenamePlain === null || filenamePlain === void 0 ? void 0 : filenamePlain[1]);
if (rawName) {
// Sanitize fileName to prevent path traversal attacks // Sanitize fileName to prevent path traversal attacks
// Use path.basename to extract only the filename component // Use path.basename to extract only the filename component
fileName = external_path_.basename(decodeURIComponent(filenameMatch[1].trim())); fileName = external_path_.basename(decodeURIComponent(rawName.trim()));
} }
core_debug(`Content-Type: ${contentType}, mimeType: ${mimeType}, urlEndsWithZip: ${urlEndsWithZip}, isZip: ${isZip}, skipDecompress: ${skipDecompress}`); core_debug(`Content-Type: ${contentType}, mimeType: ${mimeType}, urlEndsWithZip: ${urlEndsWithZip}, isZip: ${isZip}, skipDecompress: ${skipDecompress}`);
core_debug(`Content-Disposition: ${contentDisposition}, fileName: ${fileName}`); core_debug(`Content-Disposition: ${contentDisposition}, fileName: ${fileName}`);

61
dist/upload/index.js vendored
View File

@@ -79219,7 +79219,7 @@ module.exports = index;
/***/ 2822: /***/ 2822:
/***/ ((module) => { /***/ ((module) => {
module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/artifact","version":"6.2.0","preview":true,"description":"Actions artifact lib","keywords":["github","actions","artifact"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/artifact","license":"MIT","type":"module","main":"lib/artifact.js","types":"lib/artifact.d.ts","exports":{".":{"types":"./lib/artifact.d.ts","import":"./lib/artifact.js"}},"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 && cp src/internal/shared/package-version.cjs lib/internal/shared/","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":"^3.0.0","@actions/github":"^9.0.0","@actions/http-client":"^4.0.0","@azure/storage-blob":"^12.30.0","@octokit/core":"^7.0.6","@octokit/plugin-request-log":"^6.0.0","@octokit/plugin-retry":"^8.0.0","@octokit/request":"^10.0.7","@octokit/request-error":"^7.1.0","@protobuf-ts/plugin":"^2.2.3-alpha.1","@protobuf-ts/runtime":"^2.9.4","archiver":"^7.0.1","jwt-decode":"^4.0.0","unzip-stream":"^0.3.1"},"devDependencies":{"@types/archiver":"^7.0.0","@types/unzip-stream":"^0.3.4","typedoc":"^0.28.16","typedoc-plugin-markdown":"^4.9.0","typescript":"^5.9.3"},"overrides":{"uri-js":"npm:uri-js-replace@^1.0.1","node-fetch":"^3.3.2"}}'); module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/artifact","version":"6.3.1","preview":true,"description":"Actions artifact lib","keywords":["github","actions","artifact"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/artifact","license":"MIT","type":"module","main":"lib/artifact.js","types":"lib/artifact.d.ts","exports":{".":{"types":"./lib/artifact.d.ts","import":"./lib/artifact.js"}},"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 && cp src/internal/shared/package-version.cjs lib/internal/shared/","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":"^3.0.1","@actions/github":"^9.1.1","@actions/http-client":"^4.0.1","@azure/storage-blob":"^12.31.0","@octokit/core":"^7.0.6","@octokit/plugin-request-log":"^6.0.0","@octokit/plugin-retry":"^8.1.0","@octokit/request":"^10.0.8","@octokit/request-error":"^7.1.0","@protobuf-ts/runtime":"^2.11.1","@protobuf-ts/runtime-rpc":"^2.11.1","archiver":"^7.0.1","jwt-decode":"^4.0.0","unzip-stream":"^0.3.1"},"devDependencies":{"@protobuf-ts/plugin":"^2.11.1","@types/archiver":"^7.0.0","@types/unzip-stream":"^0.3.4","typedoc":"^0.28.19","typedoc-plugin-markdown":"^4.11.0","typescript":"^5.9.3"},"overrides":{"uri-js":"npm:uri-js-replace@^1.0.1","node-fetch":"^3.3.2"}}');
/***/ }) /***/ })
@@ -84265,7 +84265,7 @@ NetworkError.isNetworkErrorCode = (code) => {
}; };
class UsageError extends Error { class UsageError extends Error {
constructor() { constructor() {
const message = `Artifact storage quota has been hit. Unable to upload any new artifacts. Usage is recalculated every 6-12 hours.\nMore info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`; const message = `Artifact storage quota has been hit. Unable to upload any new artifacts.\nMore info on storage limits: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#calculating-minute-and-storage-spending`;
super(message); super(message);
this.name = 'UsageError'; this.name = 'UsageError';
} }
@@ -84475,8 +84475,9 @@ var artifact_twirp_client_awaiter = (undefined && undefined.__awaiter) || functi
class ArtifactHttpClient { class ArtifactHttpClient {
constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) {
this.maxAttempts = 5; this.maxAttempts = 5;
this.baseRetryIntervalMilliseconds = 3000; this.baseRetryIntervalMilliseconds = 8000;
this.retryMultiplier = 1.5; this.retryMultiplier = 1.5;
this.retryTimeoutMilliseconds = 120000;
const token = getRuntimeToken(); const token = getRuntimeToken();
this.baseUrl = getResultsServiceUrl(); this.baseUrl = getResultsServiceUrl();
if (maxAttempts) { if (maxAttempts) {
@@ -84515,11 +84516,16 @@ class ArtifactHttpClient {
let attempt = 0; let attempt = 0;
let errorMessage = ''; let errorMessage = '';
let rawBody = ''; let rawBody = '';
let totalRetryWaitMilliseconds = 0;
while (attempt < this.maxAttempts) { while (attempt < this.maxAttempts) {
let isRetryable = false; let isRetryable = false;
let retryAfterSeconds;
try { try {
const response = yield operation(); const response = yield operation();
const statusCode = response.message.statusCode; const statusCode = response.message.statusCode;
if (statusCode === HttpCodes.TooManyRequests) {
retryAfterSeconds = this.getRetryAfterSeconds(response);
}
rawBody = yield response.readBody(); rawBody = yield response.readBody();
core_debug(`[Response] - ${response.message.statusCode}`); core_debug(`[Response] - ${response.message.statusCode}`);
core_debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`); core_debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`);
@@ -84557,9 +84563,16 @@ class ArtifactHttpClient {
if (attempt + 1 === this.maxAttempts) { if (attempt + 1 === this.maxAttempts) {
throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${errorMessage}`); throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${errorMessage}`);
} }
const retryTimeMilliseconds = this.getExponentialRetryTimeMilliseconds(attempt); const retryTimeMilliseconds = retryAfterSeconds !== undefined
? retryAfterSeconds * 1000
: this.getExponentialRetryTimeMilliseconds(attempt);
if (totalRetryWaitMilliseconds + retryTimeMilliseconds >
this.retryTimeoutMilliseconds) {
throw new Error(`Retry wait of ${retryTimeMilliseconds} ms would exceed the maximum total retry wait of ${this.retryTimeoutMilliseconds} ms: ${errorMessage}`);
}
info(`Attempt ${attempt + 1} of ${this.maxAttempts} failed with error: ${errorMessage}. Retrying request in ${retryTimeMilliseconds} ms...`); info(`Attempt ${attempt + 1} of ${this.maxAttempts} failed with error: ${errorMessage}. Retrying request in ${retryTimeMilliseconds} ms...`);
yield this.sleep(retryTimeMilliseconds); yield this.sleep(retryTimeMilliseconds);
totalRetryWaitMilliseconds += retryTimeMilliseconds;
attempt++; attempt++;
} }
throw new Error(`Request failed`); throw new Error(`Request failed`);
@@ -84582,6 +84595,17 @@ class ArtifactHttpClient {
]; ];
return retryableStatusCodes.includes(statusCode); return retryableStatusCodes.includes(statusCode);
} }
// Only positive integer seconds are supported, not HTTP-date values.
getRetryAfterSeconds(response) {
var _a;
const header = response.message.headers['retry-after'];
const value = (_a = (Array.isArray(header) ? header[0] : header)) === null || _a === void 0 ? void 0 : _a.trim();
if (value === undefined || !/^\d+$/.test(value)) {
return undefined;
}
const parsed = parseInt(value, 10);
return !isNaN(parsed) && parsed > 0 ? parsed : undefined;
}
sleep(milliseconds) { sleep(milliseconds) {
return artifact_twirp_client_awaiter(this, void 0, void 0, function* () { return artifact_twirp_client_awaiter(this, void 0, void 0, function* () {
return new Promise(resolve => setTimeout(resolve, milliseconds)); return new Promise(resolve => setTimeout(resolve, milliseconds));
@@ -124405,6 +124429,19 @@ function getProxyFetch(destinationUrl) {
function getApiBaseUrl() { function getApiBaseUrl() {
return process.env['GITHUB_API_URL'] || 'https://api.github.com'; return process.env['GITHUB_API_URL'] || 'https://api.github.com';
} }
function getUserAgentWithOrchestrationId(baseUserAgent) {
var _a;
const orchId = (_a = process.env['ACTIONS_ORCHESTRATION_ID']) === null || _a === void 0 ? void 0 : _a.trim();
if (orchId) {
const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_');
const tag = `actions_orchestration_id/${sanitizedId}`;
if (baseUserAgent === null || baseUserAgent === void 0 ? void 0 : baseUserAgent.includes(tag))
return baseUserAgent;
const ua = baseUserAgent ? `${baseUserAgent} ` : '';
return `${ua}${tag}`;
}
return baseUserAgent;
}
//# sourceMappingURL=utils.js.map //# sourceMappingURL=utils.js.map
;// CONCATENATED MODULE: ./node_modules/universal-user-agent/index.js ;// CONCATENATED MODULE: ./node_modules/universal-user-agent/index.js
function getUserAgent() { function getUserAgent() {
@@ -128501,6 +128538,7 @@ const defaults = {
} }
}; };
const GitHub = Octokit.plugin(restEndpointMethods, paginateRest).defaults(defaults); const GitHub = Octokit.plugin(restEndpointMethods, paginateRest).defaults(defaults);
/** /**
* Convience function to correctly format Octokit Options to pass into the constructor. * Convience function to correctly format Octokit Options to pass into the constructor.
* *
@@ -128514,6 +128552,11 @@ function getOctokitOptions(token, options) {
if (auth) { if (auth) {
opts.auth = auth; opts.auth = auth;
} }
// Orchestration ID
const userAgent = getUserAgentWithOrchestrationId(opts.userAgent);
if (userAgent) {
opts.userAgent = userAgent;
}
return opts; return opts;
} }
//# sourceMappingURL=utils.js.map //# sourceMappingURL=utils.js.map
@@ -128615,13 +128658,17 @@ function streamExtractExternal(url_1, directory_1) {
mimeType === 'application/zip-compressed' || mimeType === 'application/zip-compressed' ||
urlEndsWithZip; urlEndsWithZip;
// Extract filename from Content-Disposition header // Extract filename from Content-Disposition header
// Prefer filename* (RFC 5987) which supports UTF-8 encoded filenames,
// fall back to filename which may contain ASCII-only replacements
const contentDisposition = response.message.headers['content-disposition'] || ''; const contentDisposition = response.message.headers['content-disposition'] || '';
let fileName = 'artifact'; let fileName = 'artifact';
const filenameMatch = contentDisposition.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?/i); const filenameStar = contentDisposition.match(/filename\*\s*=\s*UTF-8''([^;\r\n]*)/i);
if (filenameMatch && filenameMatch[1]) { const filenamePlain = contentDisposition.match(/(?<!\*)filename\s*=\s*['"]?([^;\r\n"']*)['"]?/i);
const rawName = (filenameStar === null || filenameStar === void 0 ? void 0 : filenameStar[1]) || (filenamePlain === null || filenamePlain === void 0 ? void 0 : filenamePlain[1]);
if (rawName) {
// Sanitize fileName to prevent path traversal attacks // Sanitize fileName to prevent path traversal attacks
// Use path.basename to extract only the filename component // Use path.basename to extract only the filename component
fileName = external_path_.basename(decodeURIComponent(filenameMatch[1].trim())); fileName = external_path_.basename(decodeURIComponent(rawName.trim()));
} }
core_debug(`Content-Type: ${contentType}, mimeType: ${mimeType}, urlEndsWithZip: ${urlEndsWithZip}, isZip: ${isZip}, skipDecompress: ${skipDecompress}`); core_debug(`Content-Type: ${contentType}, mimeType: ${mimeType}, urlEndsWithZip: ${urlEndsWithZip}, isZip: ${isZip}, skipDecompress: ${skipDecompress}`);
core_debug(`Content-Disposition: ${contentDisposition}, fileName: ${fileName}`); core_debug(`Content-Disposition: ${contentDisposition}, fileName: ${fileName}`);

125
package-lock.json generated
View File

@@ -9,7 +9,7 @@
"version": "7.0.1", "version": "7.0.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/artifact": "^6.2.0", "@actions/artifact": "^6.3.1",
"@actions/core": "^3.0.0", "@actions/core": "^3.0.0",
"@actions/github": "^9.0.0", "@actions/github": "^9.0.0",
"@actions/glob": "^0.6.1", "@actions/glob": "^0.6.1",
@@ -38,31 +38,31 @@
} }
}, },
"node_modules/@actions/artifact": { "node_modules/@actions/artifact": {
"version": "6.2.0", "version": "6.3.1",
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-6.2.0.tgz", "resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-6.3.1.tgz",
"integrity": "sha512-i9kmGy6WfuA6rby4fdD0UMKjT4MicFiKMsB5mUZ+1ggFW7+SzqvFsxLhIXxITkKUhTMVREXQfn/ZAN87EQLQDA==", "integrity": "sha512-DBXgdB9T4yj2KSe0tFg+MTi9T5se+16bdrFQh+3Y6Nq1lZ3gYQk1BjHoTof+7Zf36bEAlfVMf+8ifRKeyGJugQ==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^3.0.0", "@actions/core": "^3.0.1",
"@actions/github": "^9.0.0", "@actions/github": "^9.1.1",
"@actions/http-client": "^4.0.0", "@actions/http-client": "^4.0.1",
"@azure/storage-blob": "^12.30.0", "@azure/storage-blob": "^12.31.0",
"@octokit/core": "^7.0.6", "@octokit/core": "^7.0.6",
"@octokit/plugin-request-log": "^6.0.0", "@octokit/plugin-request-log": "^6.0.0",
"@octokit/plugin-retry": "^8.0.0", "@octokit/plugin-retry": "^8.1.0",
"@octokit/request": "^10.0.7", "@octokit/request": "^10.0.8",
"@octokit/request-error": "^7.1.0", "@octokit/request-error": "^7.1.0",
"@protobuf-ts/plugin": "^2.2.3-alpha.1", "@protobuf-ts/runtime": "^2.11.1",
"@protobuf-ts/runtime": "^2.9.4", "@protobuf-ts/runtime-rpc": "^2.11.1",
"archiver": "^7.0.1", "archiver": "^7.0.1",
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
"unzip-stream": "^0.3.1" "unzip-stream": "^0.3.1"
} }
}, },
"node_modules/@actions/core": { "node_modules/@actions/core": {
"version": "3.0.0", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-3.0.0.tgz", "resolved": "https://registry.npmjs.org/@actions/core/-/core-3.0.1.tgz",
"integrity": "sha512-zYt6cz+ivnTmiT/ksRVriMBOiuoUpDCJJlZ5KPl2/FRdvwU3f7MPh9qftvbkXJThragzUZieit2nyHUyw53Seg==", "integrity": "sha512-a6d/Nwahm9fliVGRhdhofo40HjHQasUPusmc7vBfyky+7Z+P2A1J68zyFVaNcEclc/Se+eO595oAr5nwEIoIUA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/exec": "^3.0.0", "@actions/exec": "^3.0.0",
@@ -79,9 +79,9 @@
} }
}, },
"node_modules/@actions/github": { "node_modules/@actions/github": {
"version": "9.0.0", "version": "9.1.1",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-9.0.0.tgz", "resolved": "https://registry.npmjs.org/@actions/github/-/github-9.1.1.tgz",
"integrity": "sha512-yJ0RoswsAaKcvkmpCE4XxBRiy/whH2SdTBHWzs0gi4wkqTDhXMChjSdqBz/F4AeiDlP28rQqL33iHb+kjAMX6w==", "integrity": "sha512-tL5JbYOBZHc0ngEnCsaDcryUizIUIlQyIMwy1Wkx93H5HzbBJ7TbiPx2PnFjBwZW0Vh05JmfFZhecE6gglYegA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/http-client": "^3.0.2", "@actions/http-client": "^3.0.2",
@@ -142,9 +142,9 @@
} }
}, },
"node_modules/@actions/http-client": { "node_modules/@actions/http-client": {
"version": "4.0.0", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-4.0.0.tgz", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-4.0.1.tgz",
"integrity": "sha512-QuwPsgVMsD6qaPD57GLZi9sqzAZCtiJT8kVBCDpLtxhL5MydQ4gS+DrejtZZPdIYyB1e95uCK9Luyds7ybHI3g==", "integrity": "sha512-+Nvd1ImaOZBSoPbsUtEhv+1z99H12xzncCkz0a3RuehINE81FZSe2QTj3uvAPTcJX/SCzUQHQ0D1GrPMbrPitg==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"tunnel": "^0.0.6", "tunnel": "^0.0.6",
@@ -875,36 +875,6 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/@bufbuild/protobuf": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.11.0.tgz",
"integrity": "sha512-sBXGT13cpmPR5BMgHE6UEEfEaShh5Ror6rfN3yEK5si7QVrtZg8LEPQb0VVhiLRUslD2yLnXtnRzG035J/mZXQ==",
"license": "(Apache-2.0 AND BSD-3-Clause)"
},
"node_modules/@bufbuild/protoplugin": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/@bufbuild/protoplugin/-/protoplugin-2.11.0.tgz",
"integrity": "sha512-lyZVNFUHArIOt4W0+dwYBe5GBwbKzbOy8ObaloEqsw9Mmiwv2O48TwddDoHN4itylC+BaEGqFdI1W8WQt2vWJQ==",
"license": "Apache-2.0",
"dependencies": {
"@bufbuild/protobuf": "2.11.0",
"@typescript/vfs": "^1.6.2",
"typescript": "5.4.5"
}
},
"node_modules/@bufbuild/protoplugin/node_modules/typescript": {
"version": "5.4.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/@cspotcode/source-map-support": { "node_modules/@cspotcode/source-map-support": {
"version": "0.8.1", "version": "0.8.1",
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
@@ -1965,46 +1935,6 @@
"url": "https://opencollective.com/pkgr" "url": "https://opencollective.com/pkgr"
} }
}, },
"node_modules/@protobuf-ts/plugin": {
"version": "2.11.1",
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.11.1.tgz",
"integrity": "sha512-HyuprDcw0bEEJqkOWe1rnXUP0gwYLij8YhPuZyZk6cJbIgc/Q0IFgoHQxOXNIXAcXM4Sbehh6kjVnCzasElw1A==",
"license": "Apache-2.0",
"dependencies": {
"@bufbuild/protobuf": "^2.4.0",
"@bufbuild/protoplugin": "^2.4.0",
"@protobuf-ts/protoc": "^2.11.1",
"@protobuf-ts/runtime": "^2.11.1",
"@protobuf-ts/runtime-rpc": "^2.11.1",
"typescript": "^3.9"
},
"bin": {
"protoc-gen-dump": "bin/protoc-gen-dump",
"protoc-gen-ts": "bin/protoc-gen-ts"
}
},
"node_modules/@protobuf-ts/plugin/node_modules/typescript": {
"version": "3.9.10",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
"integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=4.2.0"
}
},
"node_modules/@protobuf-ts/protoc": {
"version": "2.11.1",
"resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.11.1.tgz",
"integrity": "sha512-mUZJaV0daGO6HUX90o/atzQ6A7bbN2RSuHtdwo8SSF2Qoe3zHwa4IHyCN1evftTeHfLmdz+45qo47sL+5P8nyg==",
"license": "Apache-2.0",
"bin": {
"protoc": "protoc.js"
}
},
"node_modules/@protobuf-ts/runtime": { "node_modules/@protobuf-ts/runtime": {
"version": "2.11.1", "version": "2.11.1",
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.11.1.tgz", "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.11.1.tgz",
@@ -2464,18 +2394,6 @@
"url": "https://opencollective.com/eslint" "url": "https://opencollective.com/eslint"
} }
}, },
"node_modules/@typescript/vfs": {
"version": "1.6.4",
"resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.6.4.tgz",
"integrity": "sha512-PJFXFS4ZJKiJ9Qiuix6Dz/OwEIqHD7Dme1UwZhTK11vR+5dqW2ACbdndWQexBzCx+CPuMe5WBYQWCsFyGlQLlQ==",
"license": "MIT",
"dependencies": {
"debug": "^4.4.3"
},
"peerDependencies": {
"typescript": "*"
}
},
"node_modules/@typespec/ts-http-runtime": { "node_modules/@typespec/ts-http-runtime": {
"version": "0.3.5", "version": "0.3.5",
"resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.5.tgz", "resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.5.tgz",
@@ -9146,6 +9064,7 @@
"version": "5.9.3", "version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",

View File

@@ -33,7 +33,7 @@
"node": ">=24" "node": ">=24"
}, },
"dependencies": { "dependencies": {
"@actions/artifact": "^6.2.0", "@actions/artifact": "^6.3.1",
"@actions/core": "^3.0.0", "@actions/core": "^3.0.0",
"@actions/github": "^9.0.0", "@actions/github": "^9.0.0",
"@actions/glob": "^0.6.1", "@actions/glob": "^0.6.1",