Compare commits

..
Author SHA1 Message Date
tunc-dandCopilot App 8cbe1bebdb Bump @actions/artifact to 6.3.1
Regenerate upload and merge bundles and refresh dependency license metadata.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-06 14:56:49 +02:00
Yang Cao 043fb46d1a Merge pull request #797 from actions/yacaovsnc/update-dependency
Include changes in typespec/ts-http-runtime 0.3.5
2026-04-10 12:08:32 -04:00
Yang Cao 634250c138 Include changes in typespec/ts-http-runtime 0.3.5 2026-04-10 11:58:04 -04:00
Daniel Kennedy e454baaac2 Readme: bump all the example versions to v7 (#796) 2026-04-10 10:55:51 -04:00
Daniel Kennedy 74fad66b98 Update the readme with direct upload details (#795)
* Update the readme with direct upload details

* Update the TOC and remove a section

* Fix some wording

* Remove a tautology
2026-04-10 10:49:57 -04:00
8 changed files with 368 additions and 315 deletions

No files matched your search

+3 -3
View File
@@ -1,9 +1,9 @@
---
name: "@actions/artifact"
version: 6.2.0
version: 6.3.1
type: npm
summary: Actions artifact lib
homepage: https://github.com/actions/toolkit/tree/main/packages/artifact
summary:
homepage:
license: mit
licenses:
- sources: LICENSE.md
+3 -3
View File
@@ -1,9 +1,9 @@
---
name: "@actions/core"
version: 3.0.0
version: 3.0.1
type: npm
summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/main/packages/core
summary:
homepage:
license: mit
licenses:
- sources: LICENSE.md
+3 -3
View File
@@ -1,9 +1,9 @@
---
name: "@actions/github"
version: 9.0.0
version: 9.1.1
type: npm
summary: Actions github lib
homepage: https://github.com/actions/toolkit/tree/main/packages/github
summary:
homepage:
license: mit
licenses:
- sources: LICENSE.md
+22 -22
View File
@@ -67,7 +67,7 @@ You are welcome to still raise bugs in this repo.
### Inputs
```yaml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
# Name of the artifact to upload.
# Optional. Default is 'artifact'
@@ -131,7 +131,7 @@ You are welcome to still raise bugs in this repo.
steps:
- run: mkdir -p path/to/artifact
- run: echo hello > path/to/artifact/world.txt
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: my-artifact
path: path/to/artifact/world.txt
@@ -143,7 +143,7 @@ steps:
steps:
- run: mkdir -p path/to/artifact
- run: echo hello > path/to/artifact/world.txt
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
path: path/to/artifact/world.txt
archive: false
@@ -152,7 +152,7 @@ steps:
### Upload an Entire Directory
```yaml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: my-artifact
path: path/to/artifact/ # or path/to/artifact
@@ -161,7 +161,7 @@ steps:
### Upload using a Wildcard Pattern
```yaml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: my-artifact
path: path/**/[abc]rtifac?/*
@@ -170,7 +170,7 @@ steps:
### Upload using Multiple Paths and Exclusions
```yaml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: my-artifact
path: |
@@ -218,7 +218,7 @@ For instance, if you are uploading random binary data, you can save a lot of tim
- name: Make a 1GB random binary file
run: |
dd if=/dev/urandom of=my-1gb-file bs=1M count=1000
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: my-artifact
path: my-1gb-file
@@ -231,7 +231,7 @@ But, if you are uploading data that is easily compressed (like plaintext, code,
- name: Make a file with a lot of repeated text
run: |
for i in {1..100000}; do echo -n 'foobar' >> foobar.txt; done
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: my-artifact
path: foobar.txt
@@ -243,7 +243,7 @@ But, if you are uploading data that is easily compressed (like plaintext, code,
If a path (or paths), result in no files being found for the artifact, the action will succeed but print out a warning. In certain scenarios it may be desirable to fail the action or suppress the warning. The `if-no-files-found` option allows you to customize the behavior of the action if no files are found:
```yaml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: my-artifact
path: path/to/artifact/
@@ -256,13 +256,13 @@ Unlike earlier versions of `upload-artifact`, uploading to the same artifact via
```yaml
- run: echo hi > world.txt
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
# implicitly named as 'artifact'
path: world.txt
- run: echo howdy > extra-file.txt
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
# also implicitly named as 'artifact', will fail here!
path: extra-file.txt
@@ -288,7 +288,7 @@ jobs:
- name: Build
run: ./some-script --version=${{ matrix.version }} > my-binary
- name: Upload
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: binary-${{ matrix.os }}-${{ matrix.version }}
path: my-binary
@@ -306,7 +306,7 @@ You can use `~` in the path input as a substitute for `$HOME`. Basic tilde expan
- run: |
mkdir -p ~/new/artifact
echo hello > ~/new/artifact/world.txt
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: my-artifacts
path: ~/new/**/*
@@ -321,7 +321,7 @@ Environment variables along with context expressions can also be used for input.
- run: |
mkdir -p ${{ github.workspace }}/artifact
echo hello > ${{ github.workspace }}/artifact/world.txt
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: ${{ env.name }}-name
path: ${{ github.workspace }}/artifact/**/*
@@ -335,7 +335,7 @@ For environment variables created in other steps, make sure to use the `env` exp
mkdir testing
echo "This is a file to upload" > testing/file.txt
echo "artifactPath=testing/file.txt" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: artifact
path: ${{ env.artifactPath }} # this will resolve to testing/file.txt at runtime
@@ -350,7 +350,7 @@ Artifacts are retained for 90 days by default. You can specify a shorter retenti
run: echo "I won't live long" > my_file.txt
- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: my-artifact
path: my_file.txt
@@ -366,7 +366,7 @@ If an artifact upload is successful then an `artifact-id` output is available. T
#### Example output between steps
```yml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
id: artifact-upload-step
with:
name: my-artifact
@@ -385,7 +385,7 @@ jobs:
outputs:
output1: ${{ steps.artifact-upload-step.outputs.artifact-id }}
steps:
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
id: artifact-upload-step
with:
name: my-artifact
@@ -411,7 +411,7 @@ jobs:
- name: Create a file
run: echo "hello world" > my-file.txt
- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: my-artifact # NOTE: same artifact name
path: my-file.txt
@@ -422,7 +422,7 @@ jobs:
- name: Create a different file
run: echo "goodbye world" > my-file.txt
- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: my-artifact # NOTE: same artifact name
path: my-file.txt
@@ -438,7 +438,7 @@ Any files that contain sensitive information that should not be in the uploaded
using the `path`:
```yaml
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: my-artifact
include-hidden-files: true
@@ -470,7 +470,7 @@ If you must preserve permissions, you can `tar` all of your files together befor
run: tar -cvf my_files.tar /path/to/my/directory
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
path: my_files.tar
archive: false
+154 -87
View File
@@ -79219,7 +79219,7 @@ module.exports = index;
/***/ 2822:
/***/ ((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 {
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);
this.name = 'UsageError';
}
@@ -86900,8 +86900,9 @@ var artifact_twirp_client_awaiter = (undefined && undefined.__awaiter) || functi
class ArtifactHttpClient {
constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) {
this.maxAttempts = 5;
this.baseRetryIntervalMilliseconds = 3000;
this.baseRetryIntervalMilliseconds = 8000;
this.retryMultiplier = 1.5;
this.retryTimeoutMilliseconds = 120000;
const token = getRuntimeToken();
this.baseUrl = getResultsServiceUrl();
if (maxAttempts) {
@@ -86940,11 +86941,16 @@ class ArtifactHttpClient {
let attempt = 0;
let errorMessage = '';
let rawBody = '';
let totalRetryWaitMilliseconds = 0;
while (attempt < this.maxAttempts) {
let isRetryable = false;
let retryAfterSeconds;
try {
const response = yield operation();
const statusCode = response.message.statusCode;
if (statusCode === HttpCodes.TooManyRequests) {
retryAfterSeconds = this.getRetryAfterSeconds(response);
}
rawBody = yield response.readBody();
core_debug(`[Response] - ${response.message.statusCode}`);
core_debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`);
@@ -86982,9 +86988,16 @@ class ArtifactHttpClient {
if (attempt + 1 === this.maxAttempts) {
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...`);
yield this.sleep(retryTimeMilliseconds);
totalRetryWaitMilliseconds += retryTimeMilliseconds;
attempt++;
}
throw new Error(`Request failed`);
@@ -87007,6 +87020,17 @@ class ArtifactHttpClient {
];
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) {
return artifact_twirp_client_awaiter(this, void 0, void 0, function* () {
return new Promise(resolve => setTimeout(resolve, milliseconds));
@@ -88021,13 +88045,13 @@ class Sanitizer {
message: value.message,
};
}
if (key === "headers") {
if (key === "headers" && isObject(value)) {
return this.sanitizeHeaders(value);
}
else if (key === "url") {
else if (key === "url" && typeof value === "string") {
return this.sanitizeUrl(value);
}
else if (key === "query") {
else if (key === "query" && isObject(value)) {
return this.sanitizeQuery(value);
}
else if (key === "body") {
@@ -88598,6 +88622,68 @@ function logPolicy_logPolicy(options = {}) {
};
}
//# sourceMappingURL=logPolicy.js.map
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/redirectPolicy.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* The programmatic identifier of the redirectPolicy.
*/
const redirectPolicyName = "redirectPolicy";
/**
* Methods that are allowed to follow redirects 301 and 302
*/
const allowedRedirect = ["GET", "HEAD"];
/**
* A policy to follow Location headers from the server in order
* to support server-side redirection.
* In the browser, this policy is not used.
* @param options - Options to control policy behavior.
*/
function redirectPolicy_redirectPolicy(options = {}) {
const { maxRetries = 20, allowCrossOriginRedirects = false } = options;
return {
name: redirectPolicyName,
async sendRequest(request, next) {
const response = await next(request);
return handleRedirect(next, response, maxRetries, allowCrossOriginRedirects);
},
};
}
async function handleRedirect(next, response, maxRetries, allowCrossOriginRedirects, currentRetries = 0) {
const { request, status, headers } = response;
const locationHeader = headers.get("location");
if (locationHeader &&
(status === 300 ||
(status === 301 && allowedRedirect.includes(request.method)) ||
(status === 302 && allowedRedirect.includes(request.method)) ||
(status === 303 && request.method === "POST") ||
status === 307) &&
currentRetries < maxRetries) {
const url = new URL(locationHeader, request.url);
// Only follow redirects to the same origin by default.
if (!allowCrossOriginRedirects) {
const originalUrl = new URL(request.url);
if (url.origin !== originalUrl.origin) {
log_logger.verbose(`Skipping cross-origin redirect from ${originalUrl.origin} to ${url.origin}.`);
return response;
}
}
request.url = url.toString();
// POST request with Status code 303 should be converted into a
// redirected GET request if the redirect url is present in the location header
if (status === 303) {
request.method = "GET";
request.headers.delete("Content-Length");
delete request.body;
}
request.headers.delete("Authorization");
const res = await next(request);
return handleRedirect(next, res, maxRetries, allowCrossOriginRedirects, currentRetries + 1);
}
return response;
}
//# sourceMappingURL=redirectPolicy.js.map
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/util/userAgentPlatform.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
@@ -88615,15 +88701,14 @@ function getHeaderName() {
async function userAgentPlatform_setPlatformSpecificData(map) {
if (process && process.versions) {
const osInfo = `${os.type()} ${os.release()}; ${os.arch()}`;
const versions = process.versions;
if (versions.bun) {
map.set("Bun", `${versions.bun} (${osInfo})`);
if (process.versions.bun) {
map.set("Bun", `${process.versions.bun} (${osInfo})`);
}
else if (versions.deno) {
map.set("Deno", `${versions.deno} (${osInfo})`);
else if (process.versions.deno) {
map.set("Deno", `${process.versions.deno} (${osInfo})`);
}
else if (versions.node) {
map.set("Node", `${versions.node} (${osInfo})`);
else if (process.versions.node) {
map.set("Node", `${process.versions.node} (${osInfo})`);
}
}
}
@@ -88930,7 +89015,7 @@ function isSystemError(err) {
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/constants.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const constants_SDK_VERSION = "0.3.3";
const constants_SDK_VERSION = "0.3.5";
const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
//# sourceMappingURL=constants.js.map
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/retryPolicy.js
@@ -88940,6 +89025,7 @@ const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
const retryPolicyLogger = createClientLogger("ts-http-runtime retryPolicy");
/**
* The programmatic identifier of the retryPolicy.
@@ -88970,11 +89056,11 @@ function retryPolicy_retryPolicy(strategies, options = { maxRetries: constants_D
// RestErrors are valid targets for the retry strategies.
// If none of the retry strategies can work with them, they will be thrown later in this policy.
// If the received error is not a RestError, it is immediately thrown.
responseError = e;
if (!e || responseError.name !== "RestError") {
if (!restError_isRestError(e)) {
throw e;
}
response = responseError.response;
responseError = e;
response = e.response;
}
if (request.abortSignal?.aborted) {
logger.error(`Retry ${retryCount}: Request aborted.`);
@@ -89375,16 +89461,15 @@ function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) {
if (request.tlsSettings) {
log_logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");
}
const headers = request.headers.toJSON();
if (isInsecure) {
if (!cachedAgents.httpProxyAgent) {
cachedAgents.httpProxyAgent = new http_proxy_agent_dist.HttpProxyAgent(proxyUrl, { headers });
cachedAgents.httpProxyAgent = new http_proxy_agent_dist.HttpProxyAgent(proxyUrl);
}
request.agent = cachedAgents.httpProxyAgent;
}
else {
if (!cachedAgents.httpsProxyAgent) {
cachedAgents.httpsProxyAgent = new dist.HttpsProxyAgent(proxyUrl, { headers });
cachedAgents.httpsProxyAgent = new dist.HttpsProxyAgent(proxyUrl);
}
request.agent = cachedAgents.httpsProxyAgent;
}
@@ -89436,13 +89521,13 @@ function typeGuards_isBinaryBody(body) {
(body instanceof Uint8Array ||
typeGuards_isReadableStream(body) ||
typeof body === "function" ||
body instanceof Blob));
(typeof Blob !== "undefined" && body instanceof Blob)));
}
function typeGuards_isReadableStream(x) {
return isNodeReadableStream(x) || isWebReadableStream(x);
}
function isBlob(x) {
return typeof x.stream === "function";
function typeGuards_isBlob(x) {
return typeof Blob !== "undefined" && x instanceof Blob;
}
//# sourceMappingURL=typeGuards.js.map
// EXTERNAL MODULE: external "stream"
@@ -89488,7 +89573,7 @@ function toStream(source) {
if (source instanceof Uint8Array) {
return external_stream_.Readable.from(Buffer.from(source));
}
else if (isBlob(source)) {
else if (typeGuards_isBlob(source)) {
return ensureNodeStream(source.stream());
}
else {
@@ -89538,7 +89623,7 @@ function getLength(source) {
if (source instanceof Uint8Array) {
return source.byteLength;
}
else if (isBlob(source)) {
else if (typeGuards_isBlob(source)) {
// if was created using createFile then -1 means we have an unknown size
return source.size === -1 ? undefined : source.size;
}
@@ -90067,9 +90152,14 @@ async function sendRequest_sendRequest(method, url, pipeline, options = {}, cust
* @returns returns the content-type
*/
function getRequestContentType(options = {}) {
return (options.contentType ??
options.headers?.["content-type"] ??
getContentType(options.body));
if (options.contentType) {
return options.contentType;
}
const headerContentType = options.headers?.["content-type"];
if (typeof headerContentType === "string") {
return headerContentType;
}
return getContentType(options.body);
}
/**
* Function to determine the content-type of a body
@@ -90084,6 +90174,9 @@ function getContentType(body) {
if (ArrayBuffer.isView(body)) {
return "application/octet-stream";
}
if (isBlob(body) && body.type) {
return body.type;
}
if (typeof body === "string") {
try {
JSON.parse(body);
@@ -90134,9 +90227,15 @@ function getRequestBody(body, contentType = "") {
if (typeof FormData !== "undefined" && body instanceof FormData) {
return { body };
}
if (isBlob(body)) {
return { body };
}
if (isReadableStream(body)) {
return { body };
}
if (typeof body === "function") {
return { body: body };
}
if (ArrayBuffer.isView(body)) {
return { body: body instanceof Uint8Array ? body : JSON.stringify(body) };
}
@@ -90326,8 +90425,6 @@ function statusCodeToNumber(statusCode) {
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ./node_modules/@azure/core-rest-pipeline/dist/esm/pipeline.js
// Copyright (c) Microsoft Corporation.
@@ -90524,59 +90621,6 @@ function throttlingRetryPolicy(options = {}) {
};
}
//# sourceMappingURL=throttlingRetryPolicy.js.map
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/redirectPolicy.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* The programmatic identifier of the redirectPolicy.
*/
const redirectPolicyName = "redirectPolicy";
/**
* Methods that are allowed to follow redirects 301 and 302
*/
const allowedRedirect = ["GET", "HEAD"];
/**
* A policy to follow Location headers from the server in order
* to support server-side redirection.
* In the browser, this policy is not used.
* @param options - Options to control policy behavior.
*/
function redirectPolicy_redirectPolicy(options = {}) {
const { maxRetries = 20 } = options;
return {
name: redirectPolicyName,
async sendRequest(request, next) {
const response = await next(request);
return handleRedirect(next, response, maxRetries);
},
};
}
async function handleRedirect(next, response, maxRetries, currentRetries = 0) {
const { request, status, headers } = response;
const locationHeader = headers.get("location");
if (locationHeader &&
(status === 300 ||
(status === 301 && allowedRedirect.includes(request.method)) ||
(status === 302 && allowedRedirect.includes(request.method)) ||
(status === 303 && request.method === "POST") ||
status === 307) &&
currentRetries < maxRetries) {
const url = new URL(locationHeader, request.url);
request.url = url.toString();
// POST request with Status code 303 should be converted into a
// redirected GET request if the redirect url is present in the location header
if (status === 303) {
request.method = "GET";
request.headers.delete("Content-Length");
delete request.body;
}
request.headers.delete("Authorization");
const res = await next(request);
return handleRedirect(next, res, maxRetries, currentRetries + 1);
}
return response;
}
//# sourceMappingURL=redirectPolicy.js.map
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/tlsPolicy.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
@@ -126808,6 +126852,19 @@ function getProxyFetch(destinationUrl) {
function getApiBaseUrl() {
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
;// CONCATENATED MODULE: ./node_modules/universal-user-agent/index.js
function getUserAgent() {
@@ -130904,6 +130961,7 @@ const utils_defaults = {
}
};
const GitHub = Octokit.plugin(restEndpointMethods, paginateRest).defaults(utils_defaults);
/**
* Convience function to correctly format Octokit Options to pass into the constructor.
*
@@ -130917,6 +130975,11 @@ function getOctokitOptions(token, options) {
if (auth) {
opts.auth = auth;
}
// Orchestration ID
const userAgent = getUserAgentWithOrchestrationId(opts.userAgent);
if (userAgent) {
opts.userAgent = userAgent;
}
return opts;
}
//# sourceMappingURL=utils.js.map
@@ -131018,13 +131081,17 @@ function streamExtractExternal(url_1, directory_1) {
mimeType === 'application/zip-compressed' ||
urlEndsWithZip;
// 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'] || '';
let fileName = 'artifact';
const filenameMatch = contentDisposition.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?/i);
if (filenameMatch && filenameMatch[1]) {
const filenameStar = contentDisposition.match(/filename\*\s*=\s*UTF-8''([^;\r\n]*)/i);
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
// 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-Disposition: ${contentDisposition}, fileName: ${fileName}`);
+154 -87
View File
@@ -79219,7 +79219,7 @@ module.exports = index;
/***/ 2822:
/***/ ((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 {
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);
this.name = 'UsageError';
}
@@ -84475,8 +84475,9 @@ var artifact_twirp_client_awaiter = (undefined && undefined.__awaiter) || functi
class ArtifactHttpClient {
constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) {
this.maxAttempts = 5;
this.baseRetryIntervalMilliseconds = 3000;
this.baseRetryIntervalMilliseconds = 8000;
this.retryMultiplier = 1.5;
this.retryTimeoutMilliseconds = 120000;
const token = getRuntimeToken();
this.baseUrl = getResultsServiceUrl();
if (maxAttempts) {
@@ -84515,11 +84516,16 @@ class ArtifactHttpClient {
let attempt = 0;
let errorMessage = '';
let rawBody = '';
let totalRetryWaitMilliseconds = 0;
while (attempt < this.maxAttempts) {
let isRetryable = false;
let retryAfterSeconds;
try {
const response = yield operation();
const statusCode = response.message.statusCode;
if (statusCode === HttpCodes.TooManyRequests) {
retryAfterSeconds = this.getRetryAfterSeconds(response);
}
rawBody = yield response.readBody();
core_debug(`[Response] - ${response.message.statusCode}`);
core_debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`);
@@ -84557,9 +84563,16 @@ class ArtifactHttpClient {
if (attempt + 1 === this.maxAttempts) {
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...`);
yield this.sleep(retryTimeMilliseconds);
totalRetryWaitMilliseconds += retryTimeMilliseconds;
attempt++;
}
throw new Error(`Request failed`);
@@ -84582,6 +84595,17 @@ class ArtifactHttpClient {
];
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) {
return artifact_twirp_client_awaiter(this, void 0, void 0, function* () {
return new Promise(resolve => setTimeout(resolve, milliseconds));
@@ -85596,13 +85620,13 @@ class Sanitizer {
message: value.message,
};
}
if (key === "headers") {
if (key === "headers" && isObject(value)) {
return this.sanitizeHeaders(value);
}
else if (key === "url") {
else if (key === "url" && typeof value === "string") {
return this.sanitizeUrl(value);
}
else if (key === "query") {
else if (key === "query" && isObject(value)) {
return this.sanitizeQuery(value);
}
else if (key === "body") {
@@ -86173,6 +86197,68 @@ function logPolicy_logPolicy(options = {}) {
};
}
//# sourceMappingURL=logPolicy.js.map
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/redirectPolicy.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* The programmatic identifier of the redirectPolicy.
*/
const redirectPolicyName = "redirectPolicy";
/**
* Methods that are allowed to follow redirects 301 and 302
*/
const allowedRedirect = ["GET", "HEAD"];
/**
* A policy to follow Location headers from the server in order
* to support server-side redirection.
* In the browser, this policy is not used.
* @param options - Options to control policy behavior.
*/
function redirectPolicy_redirectPolicy(options = {}) {
const { maxRetries = 20, allowCrossOriginRedirects = false } = options;
return {
name: redirectPolicyName,
async sendRequest(request, next) {
const response = await next(request);
return handleRedirect(next, response, maxRetries, allowCrossOriginRedirects);
},
};
}
async function handleRedirect(next, response, maxRetries, allowCrossOriginRedirects, currentRetries = 0) {
const { request, status, headers } = response;
const locationHeader = headers.get("location");
if (locationHeader &&
(status === 300 ||
(status === 301 && allowedRedirect.includes(request.method)) ||
(status === 302 && allowedRedirect.includes(request.method)) ||
(status === 303 && request.method === "POST") ||
status === 307) &&
currentRetries < maxRetries) {
const url = new URL(locationHeader, request.url);
// Only follow redirects to the same origin by default.
if (!allowCrossOriginRedirects) {
const originalUrl = new URL(request.url);
if (url.origin !== originalUrl.origin) {
log_logger.verbose(`Skipping cross-origin redirect from ${originalUrl.origin} to ${url.origin}.`);
return response;
}
}
request.url = url.toString();
// POST request with Status code 303 should be converted into a
// redirected GET request if the redirect url is present in the location header
if (status === 303) {
request.method = "GET";
request.headers.delete("Content-Length");
delete request.body;
}
request.headers.delete("Authorization");
const res = await next(request);
return handleRedirect(next, res, maxRetries, allowCrossOriginRedirects, currentRetries + 1);
}
return response;
}
//# sourceMappingURL=redirectPolicy.js.map
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/util/userAgentPlatform.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
@@ -86190,15 +86276,14 @@ function getHeaderName() {
async function userAgentPlatform_setPlatformSpecificData(map) {
if (process && process.versions) {
const osInfo = `${os.type()} ${os.release()}; ${os.arch()}`;
const versions = process.versions;
if (versions.bun) {
map.set("Bun", `${versions.bun} (${osInfo})`);
if (process.versions.bun) {
map.set("Bun", `${process.versions.bun} (${osInfo})`);
}
else if (versions.deno) {
map.set("Deno", `${versions.deno} (${osInfo})`);
else if (process.versions.deno) {
map.set("Deno", `${process.versions.deno} (${osInfo})`);
}
else if (versions.node) {
map.set("Node", `${versions.node} (${osInfo})`);
else if (process.versions.node) {
map.set("Node", `${process.versions.node} (${osInfo})`);
}
}
}
@@ -86505,7 +86590,7 @@ function isSystemError(err) {
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/constants.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const constants_SDK_VERSION = "0.3.3";
const constants_SDK_VERSION = "0.3.5";
const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
//# sourceMappingURL=constants.js.map
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/retryPolicy.js
@@ -86515,6 +86600,7 @@ const constants_DEFAULT_RETRY_POLICY_COUNT = 3;
const retryPolicyLogger = createClientLogger("ts-http-runtime retryPolicy");
/**
* The programmatic identifier of the retryPolicy.
@@ -86545,11 +86631,11 @@ function retryPolicy_retryPolicy(strategies, options = { maxRetries: constants_D
// RestErrors are valid targets for the retry strategies.
// If none of the retry strategies can work with them, they will be thrown later in this policy.
// If the received error is not a RestError, it is immediately thrown.
responseError = e;
if (!e || responseError.name !== "RestError") {
if (!restError_isRestError(e)) {
throw e;
}
response = responseError.response;
responseError = e;
response = e.response;
}
if (request.abortSignal?.aborted) {
logger.error(`Retry ${retryCount}: Request aborted.`);
@@ -86950,16 +87036,15 @@ function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) {
if (request.tlsSettings) {
log_logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");
}
const headers = request.headers.toJSON();
if (isInsecure) {
if (!cachedAgents.httpProxyAgent) {
cachedAgents.httpProxyAgent = new http_proxy_agent_dist.HttpProxyAgent(proxyUrl, { headers });
cachedAgents.httpProxyAgent = new http_proxy_agent_dist.HttpProxyAgent(proxyUrl);
}
request.agent = cachedAgents.httpProxyAgent;
}
else {
if (!cachedAgents.httpsProxyAgent) {
cachedAgents.httpsProxyAgent = new dist.HttpsProxyAgent(proxyUrl, { headers });
cachedAgents.httpsProxyAgent = new dist.HttpsProxyAgent(proxyUrl);
}
request.agent = cachedAgents.httpsProxyAgent;
}
@@ -87011,13 +87096,13 @@ function typeGuards_isBinaryBody(body) {
(body instanceof Uint8Array ||
typeGuards_isReadableStream(body) ||
typeof body === "function" ||
body instanceof Blob));
(typeof Blob !== "undefined" && body instanceof Blob)));
}
function typeGuards_isReadableStream(x) {
return isNodeReadableStream(x) || isWebReadableStream(x);
}
function isBlob(x) {
return typeof x.stream === "function";
function typeGuards_isBlob(x) {
return typeof Blob !== "undefined" && x instanceof Blob;
}
//# sourceMappingURL=typeGuards.js.map
// EXTERNAL MODULE: external "stream"
@@ -87063,7 +87148,7 @@ function toStream(source) {
if (source instanceof Uint8Array) {
return external_stream_.Readable.from(Buffer.from(source));
}
else if (isBlob(source)) {
else if (typeGuards_isBlob(source)) {
return ensureNodeStream(source.stream());
}
else {
@@ -87113,7 +87198,7 @@ function getLength(source) {
if (source instanceof Uint8Array) {
return source.byteLength;
}
else if (isBlob(source)) {
else if (typeGuards_isBlob(source)) {
// if was created using createFile then -1 means we have an unknown size
return source.size === -1 ? undefined : source.size;
}
@@ -87642,9 +87727,14 @@ async function sendRequest_sendRequest(method, url, pipeline, options = {}, cust
* @returns returns the content-type
*/
function getRequestContentType(options = {}) {
return (options.contentType ??
options.headers?.["content-type"] ??
getContentType(options.body));
if (options.contentType) {
return options.contentType;
}
const headerContentType = options.headers?.["content-type"];
if (typeof headerContentType === "string") {
return headerContentType;
}
return getContentType(options.body);
}
/**
* Function to determine the content-type of a body
@@ -87659,6 +87749,9 @@ function getContentType(body) {
if (ArrayBuffer.isView(body)) {
return "application/octet-stream";
}
if (isBlob(body) && body.type) {
return body.type;
}
if (typeof body === "string") {
try {
JSON.parse(body);
@@ -87709,9 +87802,15 @@ function getRequestBody(body, contentType = "") {
if (typeof FormData !== "undefined" && body instanceof FormData) {
return { body };
}
if (isBlob(body)) {
return { body };
}
if (isReadableStream(body)) {
return { body };
}
if (typeof body === "function") {
return { body: body };
}
if (ArrayBuffer.isView(body)) {
return { body: body instanceof Uint8Array ? body : JSON.stringify(body) };
}
@@ -87901,8 +88000,6 @@ function statusCodeToNumber(statusCode) {
//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ./node_modules/@azure/core-rest-pipeline/dist/esm/pipeline.js
// Copyright (c) Microsoft Corporation.
@@ -88099,59 +88196,6 @@ function throttlingRetryPolicy(options = {}) {
};
}
//# sourceMappingURL=throttlingRetryPolicy.js.map
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/redirectPolicy.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
/**
* The programmatic identifier of the redirectPolicy.
*/
const redirectPolicyName = "redirectPolicy";
/**
* Methods that are allowed to follow redirects 301 and 302
*/
const allowedRedirect = ["GET", "HEAD"];
/**
* A policy to follow Location headers from the server in order
* to support server-side redirection.
* In the browser, this policy is not used.
* @param options - Options to control policy behavior.
*/
function redirectPolicy_redirectPolicy(options = {}) {
const { maxRetries = 20 } = options;
return {
name: redirectPolicyName,
async sendRequest(request, next) {
const response = await next(request);
return handleRedirect(next, response, maxRetries);
},
};
}
async function handleRedirect(next, response, maxRetries, currentRetries = 0) {
const { request, status, headers } = response;
const locationHeader = headers.get("location");
if (locationHeader &&
(status === 300 ||
(status === 301 && allowedRedirect.includes(request.method)) ||
(status === 302 && allowedRedirect.includes(request.method)) ||
(status === 303 && request.method === "POST") ||
status === 307) &&
currentRetries < maxRetries) {
const url = new URL(locationHeader, request.url);
request.url = url.toString();
// POST request with Status code 303 should be converted into a
// redirected GET request if the redirect url is present in the location header
if (status === 303) {
request.method = "GET";
request.headers.delete("Content-Length");
delete request.body;
}
request.headers.delete("Authorization");
const res = await next(request);
return handleRedirect(next, res, maxRetries, currentRetries + 1);
}
return response;
}
//# sourceMappingURL=redirectPolicy.js.map
;// CONCATENATED MODULE: ./node_modules/@typespec/ts-http-runtime/dist/esm/policies/tlsPolicy.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
@@ -124385,6 +124429,19 @@ function getProxyFetch(destinationUrl) {
function getApiBaseUrl() {
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
;// CONCATENATED MODULE: ./node_modules/universal-user-agent/index.js
function getUserAgent() {
@@ -128481,6 +128538,7 @@ const defaults = {
}
};
const GitHub = Octokit.plugin(restEndpointMethods, paginateRest).defaults(defaults);
/**
* Convience function to correctly format Octokit Options to pass into the constructor.
*
@@ -128494,6 +128552,11 @@ function getOctokitOptions(token, options) {
if (auth) {
opts.auth = auth;
}
// Orchestration ID
const userAgent = getUserAgentWithOrchestrationId(opts.userAgent);
if (userAgent) {
opts.userAgent = userAgent;
}
return opts;
}
//# sourceMappingURL=utils.js.map
@@ -128595,13 +128658,17 @@ function streamExtractExternal(url_1, directory_1) {
mimeType === 'application/zip-compressed' ||
urlEndsWithZip;
// 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'] || '';
let fileName = 'artifact';
const filenameMatch = contentDisposition.match(/filename\*?=['"]?(?:UTF-\d['"]*)?([^;\r\n"']*)['"]?/i);
if (filenameMatch && filenameMatch[1]) {
const filenameStar = contentDisposition.match(/filename\*\s*=\s*UTF-8''([^;\r\n]*)/i);
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
// 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-Disposition: ${contentDisposition}, fileName: ${fileName}`);
+27 -108
View File
@@ -1,15 +1,15 @@
{
"name": "upload-artifact",
"version": "7.0.0",
"version": "7.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "upload-artifact",
"version": "7.0.0",
"version": "7.0.1",
"license": "MIT",
"dependencies": {
"@actions/artifact": "^6.2.0",
"@actions/artifact": "^6.3.1",
"@actions/core": "^3.0.0",
"@actions/github": "^9.0.0",
"@actions/glob": "^0.6.1",
@@ -38,31 +38,31 @@
}
},
"node_modules/@actions/artifact": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-6.2.0.tgz",
"integrity": "sha512-i9kmGy6WfuA6rby4fdD0UMKjT4MicFiKMsB5mUZ+1ggFW7+SzqvFsxLhIXxITkKUhTMVREXQfn/ZAN87EQLQDA==",
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-6.3.1.tgz",
"integrity": "sha512-DBXgdB9T4yj2KSe0tFg+MTi9T5se+16bdrFQh+3Y6Nq1lZ3gYQk1BjHoTof+7Zf36bEAlfVMf+8ifRKeyGJugQ==",
"license": "MIT",
"dependencies": {
"@actions/core": "^3.0.0",
"@actions/github": "^9.0.0",
"@actions/http-client": "^4.0.0",
"@azure/storage-blob": "^12.30.0",
"@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.0.0",
"@octokit/request": "^10.0.7",
"@octokit/plugin-retry": "^8.1.0",
"@octokit/request": "^10.0.8",
"@octokit/request-error": "^7.1.0",
"@protobuf-ts/plugin": "^2.2.3-alpha.1",
"@protobuf-ts/runtime": "^2.9.4",
"@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"
}
},
"node_modules/@actions/core": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-3.0.0.tgz",
"integrity": "sha512-zYt6cz+ivnTmiT/ksRVriMBOiuoUpDCJJlZ5KPl2/FRdvwU3f7MPh9qftvbkXJThragzUZieit2nyHUyw53Seg==",
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-3.0.1.tgz",
"integrity": "sha512-a6d/Nwahm9fliVGRhdhofo40HjHQasUPusmc7vBfyky+7Z+P2A1J68zyFVaNcEclc/Se+eO595oAr5nwEIoIUA==",
"license": "MIT",
"dependencies": {
"@actions/exec": "^3.0.0",
@@ -79,9 +79,9 @@
}
},
"node_modules/@actions/github": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-9.0.0.tgz",
"integrity": "sha512-yJ0RoswsAaKcvkmpCE4XxBRiy/whH2SdTBHWzs0gi4wkqTDhXMChjSdqBz/F4AeiDlP28rQqL33iHb+kjAMX6w==",
"version": "9.1.1",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-9.1.1.tgz",
"integrity": "sha512-tL5JbYOBZHc0ngEnCsaDcryUizIUIlQyIMwy1Wkx93H5HzbBJ7TbiPx2PnFjBwZW0Vh05JmfFZhecE6gglYegA==",
"license": "MIT",
"dependencies": {
"@actions/http-client": "^3.0.2",
@@ -142,9 +142,9 @@
}
},
"node_modules/@actions/http-client": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-4.0.0.tgz",
"integrity": "sha512-QuwPsgVMsD6qaPD57GLZi9sqzAZCtiJT8kVBCDpLtxhL5MydQ4gS+DrejtZZPdIYyB1e95uCK9Luyds7ybHI3g==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-4.0.1.tgz",
"integrity": "sha512-+Nvd1ImaOZBSoPbsUtEhv+1z99H12xzncCkz0a3RuehINE81FZSe2QTj3uvAPTcJX/SCzUQHQ0D1GrPMbrPitg==",
"license": "MIT",
"dependencies": {
"tunnel": "^0.0.6",
@@ -875,36 +875,6 @@
"dev": true,
"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": {
"version": "0.8.1",
"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"
}
},
"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": {
"version": "2.11.1",
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.11.1.tgz",
@@ -2464,22 +2394,10 @@
"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": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.3.tgz",
"integrity": "sha512-91fp6CAAJSRtH5ja95T1FHSKa8aPW9/Zw6cta81jlZTUw/+Vq8jM/AfF/14h2b71wwR84JUTW/3Y8QPhDAawFA==",
"version": "0.3.5",
"resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.5.tgz",
"integrity": "sha512-yURCknZhvywvQItHMMmFSo+fq5arCUIyz/CVk7jD89MSai7dkaX8ufjCWp3NttLojoTVbcE72ri+be/TnEbMHw==",
"license": "MIT",
"dependencies": {
"http-proxy-agent": "^7.0.0",
@@ -9146,6 +9064,7 @@
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "upload-artifact",
"version": "7.0.0",
"version": "7.0.1",
"description": "Upload an Actions Artifact in a workflow run",
"type": "module",
"main": "dist/upload/index.js",
@@ -33,7 +33,7 @@
"node": ">=24"
},
"dependencies": {
"@actions/artifact": "^6.2.0",
"@actions/artifact": "^6.3.1",
"@actions/core": "^3.0.0",
"@actions/github": "^9.0.0",
"@actions/glob": "^0.6.1",