From 2310d5d48610de3d220d7a8d1afb0408f5255e34 Mon Sep 17 00:00:00 2001 From: tunc-d <46646394+tunc-d@users.noreply.github.com> Date: Wed, 30 Sep 2026 15:58:08 +0200 Subject: [PATCH 1/8] artifact: honor Retry-After on 429 in Twirp client When the Results service responds with HTTP 429 and a Retry-After header that parses to a positive number of seconds, wait that long before the next attempt instead of using exponential backoff. The header is read before the response body is parsed, so it is honored even when the body is not valid JSON. A missing or invalid header falls back to the existing backoff, and other retryable statuses are unchanged. Add a 120 second retry timeout per request covering both Retry-After and backoff waits: if the next wait would push the total over the limit, fail immediately instead of sleeping. Raise the default backoff base interval from 3s to 8s (multiplier 1.5, 5 attempts), so waits are 8s, 12-18s, 18-27s and 27-40.5s. A retry without Retry-After then always lands in a later minute and the backoff fits within the retry timeout. Release @actions/artifact 6.3.0. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- packages/artifact/RELEASES.md | 6 + .../__tests__/artifact-http-client.test.ts | 193 ++++++++++++++++++ packages/artifact/package-lock.json | 4 +- packages/artifact/package.json | 2 +- .../internal/shared/artifact-twirp-client.ts | 34 ++- 5 files changed, 234 insertions(+), 5 deletions(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 5dbc962609..cd34108a57 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -1,5 +1,11 @@ # @actions/artifact Releases +## 6.3.0 + +- Honor the `Retry-After` header on HTTP 429 responses in the artifact Twirp client. When the header is a valid positive number of seconds, the client waits that long before retrying instead of using exponential backoff ([#2498](https://github.com/actions/toolkit/pull/2498)) +- Add a 120 second retry timeout per request. If the next retry wait would push the total wait over 120 seconds, the request fails immediately instead of sleeping ([#2498](https://github.com/actions/toolkit/pull/2498)) +- Increase the default retry backoff base interval from 3 seconds to 8 seconds, so a retry without `Retry-After` lands in a later minute ([#2498](https://github.com/actions/toolkit/pull/2498)) + ## 6.2.2 - Bump dependency versions ([#2393](https://github.com/actions/toolkit/pull/2393)): diff --git a/packages/artifact/__tests__/artifact-http-client.test.ts b/packages/artifact/__tests__/artifact-http-client.test.ts index 84a50a6f4a..3e2d9b85d3 100644 --- a/packages/artifact/__tests__/artifact-http-client.test.ts +++ b/packages/artifact/__tests__/artifact-http-client.test.ts @@ -345,4 +345,197 @@ describe('artifact-http-client', () => { expect(mockHttpClient).toHaveBeenCalledTimes(1) expect(mockPost).toHaveBeenCalledTimes(1) }) + + describe('retry waits', () => { + let sleepSpy: jest.SpyInstance + let randomSpy: jest.SpyInstance | undefined + + const createArtifact = async ( + options?: Parameters[0] + ): Promise => + internalArtifactTwirpClient(options).CreateArtifact({ + workflowRunBackendId: '1234', + workflowJobRunBackendId: '5678', + name: 'artifact', + version: 4 + }) + + const response = ( + statusCode: number, + statusMessage: string, + headers: http.IncomingHttpHeaders = {}, + body = `{"ok": false}` + ): object => { + const msg = new http.IncomingMessage(new net.Socket()) + msg.statusCode = statusCode + msg.statusMessage = statusMessage + msg.headers = headers + return {message: msg, readBody: async () => Promise.resolve(body)} + } + + const rateLimited = (retryAfter?: string, body = `{"ok": false}`): object => + response( + 429, + 'Too Many Requests', + retryAfter === undefined ? {} : {'retry-after': retryAfter}, + body + ) + + const serverError = (): object => response(500, 'Internal Server Error') + + const mockResponses = (...responses: object[]): jest.Mock => { + const mockPost = jest.fn(() => response(200, 'OK', {}, `{"ok": true}`)) + for (const r of responses) { + mockPost.mockImplementationOnce(() => r) + } + ;(HttpClient as unknown as jest.Mock).mockImplementation(() => ({ + post: mockPost + })) + return mockPost + } + + const sleepTimes = (): number[] => + sleepSpy.mock.calls.map(call => call[1] as number) + + const sum = (values: number[]): number => + values.reduce((total, value) => total + value, 0) + + beforeEach(() => { + sleepSpy = jest.spyOn(global, 'setTimeout').mockImplementation((( + callback: () => void + ) => { + callback() + return undefined + }) as unknown as typeof setTimeout) + }) + + afterEach(() => { + sleepSpy.mockRestore() + randomSpy?.mockRestore() + randomSpy = undefined + }) + + it.each([ + ['30', 30000], + ['1.5', 1000], + ['10 ', 10000] + ])('should wait for a Retry-After of %p on 429', async (header, wait) => { + const mockPost = mockResponses(rateLimited(header)) + + await createArtifact() + + expect(mockPost).toHaveBeenCalledTimes(2) + expect(sleepTimes()).toEqual([wait]) + }) + + it('should read Retry-After before parsing the body', async () => { + mockResponses(rateLimited('20', 'rate limited')) + + await createArtifact() + + expect(sleepTimes()).toEqual([20000]) + }) + + it.each([ + ['missing', undefined], + ['empty', ''], + ['zero', '0'], + ['negative', '-5'], + ['non-numeric', 'abc'], + ['an HTTP-date', 'Wed, 21 Oct 2015 07:28:00 GMT'] + ])('should use backoff when Retry-After is %s', async (_, header) => { + mockResponses(rateLimited(header)) + + await createArtifact() + + expect(sleepTimes()).toEqual([8000]) + }) + + it.each([ + [503, 'Service Unavailable'], + [500, 'Internal Server Error'] + ])('should ignore Retry-After on %s', async (statusCode, statusMessage) => { + mockResponses(response(statusCode, statusMessage, {'retry-after': '30'})) + + await createArtifact() + + expect(sleepTimes()).toEqual([8000]) + }) + + it('should fail without sleeping once the retry timeout is exhausted', async () => { + const mockPost = mockResponses( + rateLimited('60'), + rateLimited('60'), + rateLimited('60') + ) + + await expect(createArtifact()).rejects.toThrow( + 'Failed to CreateArtifact: Retry wait of 60000 ms would exceed the maximum total retry wait of 120000 ms: Failed request: (429) Too Many Requests' + ) + expect(mockPost).toHaveBeenCalledTimes(3) + expect(sleepTimes()).toEqual([60000, 60000]) + }) + + it.each([ + ['a 121s Retry-After', [rateLimited('121')], []], + [ + 'a 113s Retry-After after an 8s backoff', + [serverError(), rateLimited('113')], + [8000] + ] + ])( + 'should fail before sleeping when %s would exceed the retry timeout', + async (_, responses, waits) => { + mockResponses(...responses) + + await expect(createArtifact()).rejects.toThrow( + 'would exceed the maximum total retry wait of 120000 ms' + ) + expect(sleepTimes()).toEqual(waits) + } + ) + + it('should allow a wait that exactly fills the retry timeout', async () => { + mockResponses(rateLimited('120')) + + await createArtifact() + + expect(sleepTimes()).toEqual([120000]) + }) + + it.each([ + ['minimum', 0, [8000, 12000, 18000, 27000]], + ['maximum', 0.9999999, [8000, 17999, 26999, 40499]] + ])( + 'should use the %s default backoff waits within the retry timeout', + async (_, random, waits) => { + randomSpy = jest.spyOn(Math, 'random').mockReturnValue(random) + const mockPost = mockResponses( + serverError(), + serverError(), + serverError(), + serverError() + ) + + await createArtifact() + + expect(mockPost).toHaveBeenCalledTimes(5) + expect(sleepTimes()).toEqual(waits) + expect(sum(sleepTimes())).toBeGreaterThanOrEqual(60000) + expect(sum(sleepTimes())).toBeLessThanOrEqual(110000) + } + ) + + it('should fail when a custom backoff wait exceeds the retry timeout', async () => { + randomSpy = jest.spyOn(Math, 'random').mockReturnValue(0) + mockResponses(serverError(), serverError(), serverError()) + + await expect( + createArtifact({retryIntervalMs: 10000, retryMultiplier: 3}) + ).rejects.toThrow( + 'Retry wait of 90000 ms would exceed the maximum total retry wait of 120000 ms: Failed request: (500) Internal Server Error' + ) + expect(sleepTimes()).toEqual([10000, 30000]) + }) + }) }) diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index b2216eee07..b221fe7d9d 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/artifact", - "version": "6.2.2", + "version": "6.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@actions/artifact", - "version": "6.2.2", + "version": "6.3.0", "license": "MIT", "dependencies": { "@actions/core": "^3.0.1", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 38bf353ca3..4d99ef846e 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "6.2.2", + "version": "6.3.0", "preview": true, "description": "Actions artifact lib", "keywords": [ diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index 04958a7840..5138958687 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -21,8 +21,9 @@ class ArtifactHttpClient implements Rpc { private httpClient: HttpClient private baseUrl: string private maxAttempts = 5 - private baseRetryIntervalMilliseconds = 3000 + private baseRetryIntervalMilliseconds = 8000 private retryMultiplier = 1.5 + private retryTimeoutMilliseconds = 120000 constructor( userAgent: string, @@ -77,12 +78,17 @@ class ArtifactHttpClient implements Rpc { let attempt = 0 let errorMessage = '' let rawBody = '' + let totalRetryWaitMilliseconds = 0 while (attempt < this.maxAttempts) { let isRetryable = false + let retryAfterSeconds: number | undefined try { const response = await operation() const statusCode = response.message.statusCode + if (statusCode === HttpCodes.TooManyRequests) { + retryAfterSeconds = this.getRetryAfterSeconds(response) + } rawBody = await response.readBody() debug(`[Response] - ${response.message.statusCode}`) debug(`Headers: ${JSON.stringify(response.message.headers, null, 2)}`) @@ -129,13 +135,24 @@ class ArtifactHttpClient implements Rpc { } const retryTimeMilliseconds = - this.getExponentialRetryTimeMilliseconds(attempt) + 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...` ) await this.sleep(retryTimeMilliseconds) + totalRetryWaitMilliseconds += retryTimeMilliseconds attempt++ } @@ -161,6 +178,19 @@ class ArtifactHttpClient implements Rpc { return retryableStatusCodes.includes(statusCode) } + // Returns the Retry-After header value in seconds if it is a positive + // number, otherwise undefined (HTTP-date values are not supported) + getRetryAfterSeconds(response: HttpClientResponse): number | undefined { + const header = response.message.headers['retry-after'] + const value = Array.isArray(header) ? header[0] : header + if (value === undefined) { + return undefined + } + + const parsed = parseInt(value) + return !isNaN(parsed) && parsed > 0 ? parsed : undefined + } + async sleep(milliseconds: number): Promise { return new Promise(resolve => setTimeout(resolve, milliseconds)) } From 96a554adc0d46b0850b5f1acb63aa108753f177e Mon Sep 17 00:00:00 2001 From: tunc-d <46646394+tunc-d@users.noreply.github.com> Date: Wed, 30 Sep 2026 16:57:18 +0200 Subject: [PATCH 2/8] chore(deps): fix npm audit findings Fix the moderate+ npm audit findings that make the Audit check fail on main by changing the package.json declarations that pull in the vulnerable versions, then regenerating the lockfiles with npm: - http-client: raise undici to ^6.28.1 - core, tool-cache: override undici to ^6.28.1 (via the published @actions/http-client) - glob: override undici to ^6.28.1 and brace-expansion to ^5.0.12 (via minimatch) - artifact: override brace-expansion 2.x to ^2.1.7 (via archiver) and 5.x to ^5.0.12 (via typedoc), undici to ^6.28.1 and markdown-it to ^14.3.1 (via typedoc) Overrides are per package because audit-all installs each package separately. No major versions change. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- packages/artifact/RELEASES.md | 1 + packages/artifact/package-lock.json | 30 +++++++++++++------------- packages/artifact/package.json | 6 +++++- packages/core/package-lock.json | 6 +++--- packages/core/package.json | 3 +++ packages/glob/package-lock.json | 14 ++++++------ packages/glob/package.json | 4 ++++ packages/http-client/package-lock.json | 8 +++---- packages/http-client/package.json | 2 +- packages/tool-cache/package-lock.json | 6 +++--- packages/tool-cache/package.json | 3 +++ 11 files changed, 49 insertions(+), 34 deletions(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index cd34108a57..48b2690ef1 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -5,6 +5,7 @@ - Honor the `Retry-After` header on HTTP 429 responses in the artifact Twirp client. When the header is a valid positive number of seconds, the client waits that long before retrying instead of using exponential backoff ([#2498](https://github.com/actions/toolkit/pull/2498)) - Add a 120 second retry timeout per request. If the next retry wait would push the total wait over 120 seconds, the request fails immediately instead of sleeping ([#2498](https://github.com/actions/toolkit/pull/2498)) - Increase the default retry backoff base interval from 3 seconds to 8 seconds, so a retry without `Retry-After` lands in a later minute ([#2498](https://github.com/actions/toolkit/pull/2498)) +- Add dependency overrides for `brace-expansion`, `undici` and `markdown-it` to address security advisories ([#2498](https://github.com/actions/toolkit/pull/2498)) ## 6.2.2 diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index b221fe7d9d..36ec2bf938 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -903,9 +903,9 @@ "license": "MIT" }, "node_modules/brace-expansion": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", - "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", + "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -1410,9 +1410,9 @@ "license": "MIT" }, "node_modules/markdown-it": { - "version": "14.2.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.2.0.tgz", - "integrity": "sha512-1TGiQiJVRQ3NPmZH6sx5Cfnmg6GQm9jvC1ch4TK511NjSJvjzKLzn5pPfZRNZkRPZP0HqCioSndqH8v2nRaWVQ==", + "version": "14.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.3.2.tgz", + "integrity": "sha512-sHHjZ5fJKlgrG4qns2YwVcdNep35h5fERrfkD2YNsb9UFk0UIHarbiTaHKVMlPuWAoiilyK8Fv/jAm11slsY7Q==", "dev": true, "funding": [ { @@ -1427,8 +1427,8 @@ "license": "MIT", "dependencies": { "argparse": "^2.0.1", - "entities": "^4.4.0", - "linkify-it": "^5.0.1", + "entities": "^4.5.0", + "linkify-it": "^5.0.2", "mdurl": "^2.0.0", "punycode.js": "^2.3.1", "uc.micro": "^2.1.0" @@ -1885,16 +1885,16 @@ } }, "node_modules/typedoc/node_modules/brace-expansion": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", - "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^4.0.2" }, "engines": { - "node": "18 || 20 || >=22" + "node": "20 || >=22" } }, "node_modules/typedoc/node_modules/minimatch": { @@ -1935,9 +1935,9 @@ "license": "MIT" }, "node_modules/undici": { - "version": "6.28.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.28.0.tgz", - "integrity": "sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==", + "version": "6.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", + "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 4d99ef846e..1625317918 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -71,6 +71,10 @@ }, "overrides": { "uri-js": "npm:uri-js-replace@^1.0.1", - "node-fetch": "^3.3.2" + "node-fetch": "^3.3.2", + "brace-expansion@^2": "^2.1.7", + "brace-expansion@^5": "^5.0.12", + "undici": "^6.28.1", + "markdown-it": "^14.3.1" } } diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index 1a493b051a..36c897f004 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -61,9 +61,9 @@ } }, "node_modules/undici": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.1.tgz", - "integrity": "sha512-sC+b0tB1whOCzbtlx20fx3WgCXwkW627p4EA9uM+/tNNPkSS+eSEld6pAs9nDv7WbY1UUljBMYPtu9BCOrCWKA==", + "version": "6.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", + "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/core/package.json b/packages/core/package.json index 01f93cd7fa..8028e00d39 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -48,5 +48,8 @@ }, "devDependencies": { "@types/node": "^25.1.0" + }, + "overrides": { + "undici": "^6.28.1" } } \ No newline at end of file diff --git a/packages/glob/package-lock.json b/packages/glob/package-lock.json index 02937672fc..8850401606 100644 --- a/packages/glob/package-lock.json +++ b/packages/glob/package-lock.json @@ -58,15 +58,15 @@ } }, "node_modules/brace-expansion": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", - "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "license": "MIT", "dependencies": { "balanced-match": "^4.0.2" }, "engines": { - "node": "18 || 20 || >=22" + "node": "20 || >=22" } }, "node_modules/minimatch": { @@ -94,9 +94,9 @@ } }, "node_modules/undici": { - "version": "6.24.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.0.tgz", - "integrity": "sha512-lVLNosgqo5EkGqh5XUDhGfsMSoO8K0BAN0TyJLvwNRSl4xWGZlCVYsAIpa/OpA3TvmnM01GWcoKmc3ZWo5wKKA==", + "version": "6.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", + "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/glob/package.json b/packages/glob/package.json index 7e2f940189..e6149f6aca 100644 --- a/packages/glob/package.json +++ b/packages/glob/package.json @@ -46,5 +46,9 @@ "dependencies": { "@actions/core": "^3.0.0", "minimatch": "^10.2.5" + }, + "overrides": { + "undici": "^6.28.1", + "brace-expansion": "^5.0.12" } } diff --git a/packages/http-client/package-lock.json b/packages/http-client/package-lock.json index 52574b6c24..98697eb23c 100644 --- a/packages/http-client/package-lock.json +++ b/packages/http-client/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "tunnel": "^0.0.6", - "undici": "^6.23.0" + "undici": "^6.28.1" }, "devDependencies": { "@types/node": "24.1.0", @@ -232,9 +232,9 @@ } }, "node_modules/undici": { - "version": "6.24.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.0.tgz", - "integrity": "sha512-lVLNosgqo5EkGqh5XUDhGfsMSoO8K0BAN0TyJLvwNRSl4xWGZlCVYsAIpa/OpA3TvmnM01GWcoKmc3ZWo5wKKA==", + "version": "6.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", + "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/http-client/package.json b/packages/http-client/package.json index e6e89452f7..086546e9c5 100644 --- a/packages/http-client/package.json +++ b/packages/http-client/package.json @@ -65,7 +65,7 @@ }, "dependencies": { "tunnel": "^0.0.6", - "undici": "^6.23.0" + "undici": "^6.28.1" }, "overrides": { "uri-js": "npm:uri-js-replace@^1.0.1" diff --git a/packages/tool-cache/package-lock.json b/packages/tool-cache/package-lock.json index c2245c5b13..bd0f347cba 100644 --- a/packages/tool-cache/package-lock.json +++ b/packages/tool-cache/package-lock.json @@ -141,9 +141,9 @@ } }, "node_modules/undici": { - "version": "6.25.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.25.0.tgz", - "integrity": "sha512-ZgpWDC5gmNiuY9CnLVXEH8rl50xhRCuLNA97fAUnKi8RRuV4E6KG31pDTsLVUKnohJE0I3XDrTeEydAXRw47xg==", + "version": "6.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", + "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/tool-cache/package.json b/packages/tool-cache/package.json index 4f65484fa1..f0b9583865 100644 --- a/packages/tool-cache/package.json +++ b/packages/tool-cache/package.json @@ -52,5 +52,8 @@ "devDependencies": { "@types/semver": "^7.7.1", "nock": "^13.5.1" + }, + "overrides": { + "undici": "^6.28.1" } } From 4449111a58521b9b60acc34e693ae8a69b4efbe6 Mon Sep 17 00:00:00 2001 From: tunc-d <46646394+tunc-d@users.noreply.github.com> Date: Thu, 1 Oct 2026 12:25:57 +0200 Subject: [PATCH 3/8] artifact: isolate retry behavior and validate Retry-After Remove dependency audit and release metadata deltas for separate PRs. Parse trimmed decimal integer seconds with an explicit radix and cover invalid headers, retry limits, and accumulated wait boundaries. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- packages/artifact/RELEASES.md | 7 -- .../__tests__/artifact-http-client.test.ts | 68 ++++++++++++++++--- packages/artifact/package-lock.json | 34 +++++----- packages/artifact/package.json | 8 +-- .../internal/shared/artifact-twirp-client.ts | 9 ++- packages/core/package-lock.json | 6 +- packages/core/package.json | 3 - packages/glob/package-lock.json | 14 ++-- packages/glob/package.json | 4 -- packages/http-client/package-lock.json | 8 +-- packages/http-client/package.json | 2 +- packages/tool-cache/package-lock.json | 6 +- packages/tool-cache/package.json | 3 - 13 files changed, 101 insertions(+), 71 deletions(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 48b2690ef1..5dbc962609 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -1,12 +1,5 @@ # @actions/artifact Releases -## 6.3.0 - -- Honor the `Retry-After` header on HTTP 429 responses in the artifact Twirp client. When the header is a valid positive number of seconds, the client waits that long before retrying instead of using exponential backoff ([#2498](https://github.com/actions/toolkit/pull/2498)) -- Add a 120 second retry timeout per request. If the next retry wait would push the total wait over 120 seconds, the request fails immediately instead of sleeping ([#2498](https://github.com/actions/toolkit/pull/2498)) -- Increase the default retry backoff base interval from 3 seconds to 8 seconds, so a retry without `Retry-After` lands in a later minute ([#2498](https://github.com/actions/toolkit/pull/2498)) -- Add dependency overrides for `brace-expansion`, `undici` and `markdown-it` to address security advisories ([#2498](https://github.com/actions/toolkit/pull/2498)) - ## 6.2.2 - Bump dependency versions ([#2393](https://github.com/actions/toolkit/pull/2393)): diff --git a/packages/artifact/__tests__/artifact-http-client.test.ts b/packages/artifact/__tests__/artifact-http-client.test.ts index 3e2d9b85d3..64efcb8e11 100644 --- a/packages/artifact/__tests__/artifact-http-client.test.ts +++ b/packages/artifact/__tests__/artifact-http-client.test.ts @@ -417,8 +417,9 @@ describe('artifact-http-client', () => { it.each([ ['30', 30000], - ['1.5', 1000], - ['10 ', 10000] + ['010', 10000], + ['10 ', 10000], + [' 10 ', 10000] ])('should wait for a Retry-After of %p on 429', async (header, wait) => { const mockPost = mockResponses(rateLimited(header)) @@ -439,8 +440,18 @@ describe('artifact-http-client', () => { it.each([ ['missing', undefined], ['empty', ''], + ['whitespace', ' '], ['zero', '0'], + ['padded zero', '000'], ['negative', '-5'], + ['fractional', '1.5'], + ['decimal', '1.0'], + ['a positive sign', '+5'], + ['hexadecimal', '0x10'], + ['scientific notation', '1e2'], + ['trailing junk', '10seconds'], + ['prefix junk', 'seconds10'], + ['embedded whitespace', '1 0'], ['non-numeric', 'abc'], ['an HTTP-date', 'Wed, 21 Oct 2015 07:28:00 GMT'] ])('should use backoff when Retry-After is %s', async (_, header) => { @@ -453,7 +464,9 @@ describe('artifact-http-client', () => { it.each([ [503, 'Service Unavailable'], - [500, 'Internal Server Error'] + [500, 'Internal Server Error'], + [502, 'Bad Gateway'], + [504, 'Gateway Timeout'] ])('should ignore Retry-After on %s', async (statusCode, statusMessage) => { mockResponses(response(statusCode, statusMessage, {'retry-after': '30'})) @@ -477,30 +490,69 @@ describe('artifact-http-client', () => { }) it.each([ - ['a 121s Retry-After', [rateLimited('121')], []], + ['a 121s Retry-After', [rateLimited('121')], [], 1], [ 'a 113s Retry-After after an 8s backoff', [serverError(), rateLimited('113')], - [8000] + [8000], + 2 ] ])( 'should fail before sleeping when %s would exceed the retry timeout', - async (_, responses, waits) => { - mockResponses(...responses) + async (_, responses, waits, attempts) => { + const mockPost = mockResponses(...responses) await expect(createArtifact()).rejects.toThrow( 'would exceed the maximum total retry wait of 120000 ms' ) expect(sleepTimes()).toEqual(waits) + expect(mockPost).toHaveBeenCalledTimes(attempts) } ) it('should allow a wait that exactly fills the retry timeout', async () => { - mockResponses(rateLimited('120')) + const mockPost = mockResponses(rateLimited('120')) await createArtifact() expect(sleepTimes()).toEqual([120000]) + expect(mockPost).toHaveBeenCalledTimes(2) + }) + + it('should allow mixed waits that exactly fill the retry timeout', async () => { + const mockPost = mockResponses(serverError(), rateLimited('112')) + + await createArtifact() + + expect(sleepTimes()).toEqual([8000, 112000]) + expect(mockPost).toHaveBeenCalledTimes(3) + }) + + it('should use backoff after a 429 without reusing its Retry-After', async () => { + randomSpy = jest.spyOn(Math, 'random').mockReturnValue(0) + const mockPost = mockResponses(rateLimited('30'), serverError()) + + await createArtifact() + + expect(sleepTimes()).toEqual([30000, 12000]) + expect(mockPost).toHaveBeenCalledTimes(3) + }) + + it('should stop after five attempts without sleeping after the last failure', async () => { + const mockPost = mockResponses( + rateLimited('30'), + rateLimited('30'), + rateLimited('30'), + rateLimited('30'), + rateLimited('30') + ) + + await expect(createArtifact()).rejects.toThrow( + 'Failed to make request after 5 attempts: Failed request: (429) Too Many Requests' + ) + + expect(mockPost).toHaveBeenCalledTimes(5) + expect(sleepTimes()).toEqual([30000, 30000, 30000, 30000]) }) it.each([ diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index 36ec2bf938..b2216eee07 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/artifact", - "version": "6.3.0", + "version": "6.2.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@actions/artifact", - "version": "6.3.0", + "version": "6.2.2", "license": "MIT", "dependencies": { "@actions/core": "^3.0.1", @@ -903,9 +903,9 @@ "license": "MIT" }, "node_modules/brace-expansion": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", - "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", + "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -1410,9 +1410,9 @@ "license": "MIT" }, "node_modules/markdown-it": { - "version": "14.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.3.2.tgz", - "integrity": "sha512-sHHjZ5fJKlgrG4qns2YwVcdNep35h5fERrfkD2YNsb9UFk0UIHarbiTaHKVMlPuWAoiilyK8Fv/jAm11slsY7Q==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.2.0.tgz", + "integrity": "sha512-1TGiQiJVRQ3NPmZH6sx5Cfnmg6GQm9jvC1ch4TK511NjSJvjzKLzn5pPfZRNZkRPZP0HqCioSndqH8v2nRaWVQ==", "dev": true, "funding": [ { @@ -1427,8 +1427,8 @@ "license": "MIT", "dependencies": { "argparse": "^2.0.1", - "entities": "^4.5.0", - "linkify-it": "^5.0.2", + "entities": "^4.4.0", + "linkify-it": "^5.0.1", "mdurl": "^2.0.0", "punycode.js": "^2.3.1", "uc.micro": "^2.1.0" @@ -1885,16 +1885,16 @@ } }, "node_modules/typedoc/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^4.0.2" }, "engines": { - "node": "20 || >=22" + "node": "18 || 20 || >=22" } }, "node_modules/typedoc/node_modules/minimatch": { @@ -1935,9 +1935,9 @@ "license": "MIT" }, "node_modules/undici": { - "version": "6.29.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", - "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", + "version": "6.28.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.28.0.tgz", + "integrity": "sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 1625317918..38bf353ca3 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "6.3.0", + "version": "6.2.2", "preview": true, "description": "Actions artifact lib", "keywords": [ @@ -71,10 +71,6 @@ }, "overrides": { "uri-js": "npm:uri-js-replace@^1.0.1", - "node-fetch": "^3.3.2", - "brace-expansion@^2": "^2.1.7", - "brace-expansion@^5": "^5.0.12", - "undici": "^6.28.1", - "markdown-it": "^14.3.1" + "node-fetch": "^3.3.2" } } diff --git a/packages/artifact/src/internal/shared/artifact-twirp-client.ts b/packages/artifact/src/internal/shared/artifact-twirp-client.ts index 5138958687..e48d1a7011 100644 --- a/packages/artifact/src/internal/shared/artifact-twirp-client.ts +++ b/packages/artifact/src/internal/shared/artifact-twirp-client.ts @@ -178,16 +178,15 @@ class ArtifactHttpClient implements Rpc { return retryableStatusCodes.includes(statusCode) } - // Returns the Retry-After header value in seconds if it is a positive - // number, otherwise undefined (HTTP-date values are not supported) + // Only positive integer seconds are supported, not HTTP-date values. getRetryAfterSeconds(response: HttpClientResponse): number | undefined { const header = response.message.headers['retry-after'] - const value = Array.isArray(header) ? header[0] : header - if (value === undefined) { + const value = (Array.isArray(header) ? header[0] : header)?.trim() + if (value === undefined || !/^\d+$/.test(value)) { return undefined } - const parsed = parseInt(value) + const parsed = parseInt(value, 10) return !isNaN(parsed) && parsed > 0 ? parsed : undefined } diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index 36c897f004..1a493b051a 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -61,9 +61,9 @@ } }, "node_modules/undici": { - "version": "6.29.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", - "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.1.tgz", + "integrity": "sha512-sC+b0tB1whOCzbtlx20fx3WgCXwkW627p4EA9uM+/tNNPkSS+eSEld6pAs9nDv7WbY1UUljBMYPtu9BCOrCWKA==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/core/package.json b/packages/core/package.json index 8028e00d39..01f93cd7fa 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -48,8 +48,5 @@ }, "devDependencies": { "@types/node": "^25.1.0" - }, - "overrides": { - "undici": "^6.28.1" } } \ No newline at end of file diff --git a/packages/glob/package-lock.json b/packages/glob/package-lock.json index 8850401606..02937672fc 100644 --- a/packages/glob/package-lock.json +++ b/packages/glob/package-lock.json @@ -58,15 +58,15 @@ } }, "node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", + "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", "license": "MIT", "dependencies": { "balanced-match": "^4.0.2" }, "engines": { - "node": "20 || >=22" + "node": "18 || 20 || >=22" } }, "node_modules/minimatch": { @@ -94,9 +94,9 @@ } }, "node_modules/undici": { - "version": "6.29.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", - "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", + "version": "6.24.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.0.tgz", + "integrity": "sha512-lVLNosgqo5EkGqh5XUDhGfsMSoO8K0BAN0TyJLvwNRSl4xWGZlCVYsAIpa/OpA3TvmnM01GWcoKmc3ZWo5wKKA==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/glob/package.json b/packages/glob/package.json index e6149f6aca..7e2f940189 100644 --- a/packages/glob/package.json +++ b/packages/glob/package.json @@ -46,9 +46,5 @@ "dependencies": { "@actions/core": "^3.0.0", "minimatch": "^10.2.5" - }, - "overrides": { - "undici": "^6.28.1", - "brace-expansion": "^5.0.12" } } diff --git a/packages/http-client/package-lock.json b/packages/http-client/package-lock.json index 98697eb23c..52574b6c24 100644 --- a/packages/http-client/package-lock.json +++ b/packages/http-client/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "tunnel": "^0.0.6", - "undici": "^6.28.1" + "undici": "^6.23.0" }, "devDependencies": { "@types/node": "24.1.0", @@ -232,9 +232,9 @@ } }, "node_modules/undici": { - "version": "6.29.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", - "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", + "version": "6.24.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.0.tgz", + "integrity": "sha512-lVLNosgqo5EkGqh5XUDhGfsMSoO8K0BAN0TyJLvwNRSl4xWGZlCVYsAIpa/OpA3TvmnM01GWcoKmc3ZWo5wKKA==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/http-client/package.json b/packages/http-client/package.json index 086546e9c5..e6e89452f7 100644 --- a/packages/http-client/package.json +++ b/packages/http-client/package.json @@ -65,7 +65,7 @@ }, "dependencies": { "tunnel": "^0.0.6", - "undici": "^6.28.1" + "undici": "^6.23.0" }, "overrides": { "uri-js": "npm:uri-js-replace@^1.0.1" diff --git a/packages/tool-cache/package-lock.json b/packages/tool-cache/package-lock.json index bd0f347cba..c2245c5b13 100644 --- a/packages/tool-cache/package-lock.json +++ b/packages/tool-cache/package-lock.json @@ -141,9 +141,9 @@ } }, "node_modules/undici": { - "version": "6.29.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", - "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.25.0.tgz", + "integrity": "sha512-ZgpWDC5gmNiuY9CnLVXEH8rl50xhRCuLNA97fAUnKi8RRuV4E6KG31pDTsLVUKnohJE0I3XDrTeEydAXRw47xg==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/tool-cache/package.json b/packages/tool-cache/package.json index f0b9583865..4f65484fa1 100644 --- a/packages/tool-cache/package.json +++ b/packages/tool-cache/package.json @@ -52,8 +52,5 @@ "devDependencies": { "@types/semver": "^7.7.1", "nock": "^13.5.1" - }, - "overrides": { - "undici": "^6.28.1" } } From 2511873a0eb2f2e0182c598ddd02d6f9ec564aed Mon Sep 17 00:00:00 2001 From: tunc-d <46646394+tunc-d@users.noreply.github.com> Date: Thu, 1 Oct 2026 12:43:21 +0200 Subject: [PATCH 4/8] artifact: keep 6.3.0 release metadata with retry change Restore the artifact version and retry-only release notes alongside its implementation. Keep the separate HTTP-client and audit dependency work out of this PR. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- packages/artifact/RELEASES.md | 6 ++++++ packages/artifact/package-lock.json | 4 ++-- packages/artifact/package.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/artifact/RELEASES.md b/packages/artifact/RELEASES.md index 5dbc962609..3b26c09674 100644 --- a/packages/artifact/RELEASES.md +++ b/packages/artifact/RELEASES.md @@ -1,5 +1,11 @@ # @actions/artifact Releases +## 6.3.0 + +- Honor the `Retry-After` header on HTTP 429 responses in the artifact Twirp client when it contains a positive integer number of seconds. Unsupported values fall back to exponential backoff ([#2498](https://github.com/actions/toolkit/pull/2498)). +- Cap accumulated retry sleeps at 120 seconds per request, failing before the next sleep would exceed the cap. This is not a wall-clock timeout for HTTP requests ([#2498](https://github.com/actions/toolkit/pull/2498)). +- Increase the fallback retry backoff base interval from 3 seconds to 8 seconds, retaining the 1.5 multiplier and maximum of 5 attempts ([#2498](https://github.com/actions/toolkit/pull/2498)). + ## 6.2.2 - Bump dependency versions ([#2393](https://github.com/actions/toolkit/pull/2393)): diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index b2216eee07..b221fe7d9d 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -1,12 +1,12 @@ { "name": "@actions/artifact", - "version": "6.2.2", + "version": "6.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@actions/artifact", - "version": "6.2.2", + "version": "6.3.0", "license": "MIT", "dependencies": { "@actions/core": "^3.0.1", diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 38bf353ca3..4d99ef846e 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "6.2.2", + "version": "6.3.0", "preview": true, "description": "Actions artifact lib", "keywords": [ From 1ee105142b4ddcd5a23503852aaaa0f6962bff22 Mon Sep 17 00:00:00 2001 From: tunc-d <46646394+tunc-d@users.noreply.github.com> Date: Thu, 1 Oct 2026 13:24:13 +0200 Subject: [PATCH 5/8] http-client: bump Undici and prepare 4.0.2 Raise the Undici minimum to 6.28.1 and regenerate the package lockfile at 6.29.0. Prepare only the HTTP-client patch release; leave consumer upgrades and artifact behavior to their own layers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- packages/http-client/RELEASES.md | 4 ++++ packages/http-client/package-lock.json | 12 ++++++------ packages/http-client/package.json | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/http-client/RELEASES.md b/packages/http-client/RELEASES.md index 93b4b49a74..e66015b792 100644 --- a/packages/http-client/RELEASES.md +++ b/packages/http-client/RELEASES.md @@ -1,5 +1,9 @@ # Releases +## 4.0.2 + +- Bump the minimum `undici` version from `6.23.0` to `6.28.1` and refresh the lockfile to `6.29.0`. + ## 4.0.1 - Bump `undici` from `6.23.0` to `6.24.0` [#2347](https://github.com/actions/toolkit/pull/2347) diff --git a/packages/http-client/package-lock.json b/packages/http-client/package-lock.json index 52574b6c24..34e7c85f1d 100644 --- a/packages/http-client/package-lock.json +++ b/packages/http-client/package-lock.json @@ -1,16 +1,16 @@ { "name": "@actions/http-client", - "version": "4.0.1", + "version": "4.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@actions/http-client", - "version": "4.0.1", + "version": "4.0.2", "license": "MIT", "dependencies": { "tunnel": "^0.0.6", - "undici": "^6.23.0" + "undici": "^6.28.1" }, "devDependencies": { "@types/node": "24.1.0", @@ -232,9 +232,9 @@ } }, "node_modules/undici": { - "version": "6.24.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.0.tgz", - "integrity": "sha512-lVLNosgqo5EkGqh5XUDhGfsMSoO8K0BAN0TyJLvwNRSl4xWGZlCVYsAIpa/OpA3TvmnM01GWcoKmc3ZWo5wKKA==", + "version": "6.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", + "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/http-client/package.json b/packages/http-client/package.json index e6e89452f7..4a9e91516f 100644 --- a/packages/http-client/package.json +++ b/packages/http-client/package.json @@ -1,6 +1,6 @@ { "name": "@actions/http-client", - "version": "4.0.1", + "version": "4.0.2", "description": "Actions Http Client", "keywords": [ "github", @@ -65,7 +65,7 @@ }, "dependencies": { "tunnel": "^0.0.6", - "undici": "^6.23.0" + "undici": "^6.28.1" }, "overrides": { "uri-js": "npm:uri-js-replace@^1.0.1" From 9f3eeb5a80f03d4c83cb8343f55f2d92bef89349 Mon Sep 17 00:00:00 2001 From: tunc-d <46646394+tunc-d@users.noreply.github.com> Date: Thu, 1 Oct 2026 13:35:33 +0200 Subject: [PATCH 6/8] chore: refresh published dependency audit fixes Regenerate the assigned consumer locks with published patch releases while retaining existing HTTP-client major versions and consumer ranges. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- packages/artifact/package-lock.json | 30 +++++++++++++-------------- packages/artifact/package.json | 5 ++++- packages/core/package-lock.json | 6 +++--- packages/glob/package-lock.json | 14 ++++++------- packages/glob/package.json | 3 +++ packages/tool-cache/package-lock.json | 6 +++--- 6 files changed, 35 insertions(+), 29 deletions(-) diff --git a/packages/artifact/package-lock.json b/packages/artifact/package-lock.json index b2216eee07..371098937a 100644 --- a/packages/artifact/package-lock.json +++ b/packages/artifact/package-lock.json @@ -903,9 +903,9 @@ "license": "MIT" }, "node_modules/brace-expansion": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", - "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", + "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -1410,9 +1410,9 @@ "license": "MIT" }, "node_modules/markdown-it": { - "version": "14.2.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.2.0.tgz", - "integrity": "sha512-1TGiQiJVRQ3NPmZH6sx5Cfnmg6GQm9jvC1ch4TK511NjSJvjzKLzn5pPfZRNZkRPZP0HqCioSndqH8v2nRaWVQ==", + "version": "14.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.3.2.tgz", + "integrity": "sha512-sHHjZ5fJKlgrG4qns2YwVcdNep35h5fERrfkD2YNsb9UFk0UIHarbiTaHKVMlPuWAoiilyK8Fv/jAm11slsY7Q==", "dev": true, "funding": [ { @@ -1427,8 +1427,8 @@ "license": "MIT", "dependencies": { "argparse": "^2.0.1", - "entities": "^4.4.0", - "linkify-it": "^5.0.1", + "entities": "^4.5.0", + "linkify-it": "^5.0.2", "mdurl": "^2.0.0", "punycode.js": "^2.3.1", "uc.micro": "^2.1.0" @@ -1885,16 +1885,16 @@ } }, "node_modules/typedoc/node_modules/brace-expansion": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", - "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^4.0.2" }, "engines": { - "node": "18 || 20 || >=22" + "node": "20 || >=22" } }, "node_modules/typedoc/node_modules/minimatch": { @@ -1935,9 +1935,9 @@ "license": "MIT" }, "node_modules/undici": { - "version": "6.28.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.28.0.tgz", - "integrity": "sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==", + "version": "6.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", + "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 38bf353ca3..1f0fc59f65 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -71,6 +71,9 @@ }, "overrides": { "uri-js": "npm:uri-js-replace@^1.0.1", - "node-fetch": "^3.3.2" + "node-fetch": "^3.3.2", + "brace-expansion@^2": "^2.1.7", + "brace-expansion@^5": "^5.0.12", + "markdown-it": "^14.3.1" } } diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index 1a493b051a..36c897f004 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -61,9 +61,9 @@ } }, "node_modules/undici": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.1.tgz", - "integrity": "sha512-sC+b0tB1whOCzbtlx20fx3WgCXwkW627p4EA9uM+/tNNPkSS+eSEld6pAs9nDv7WbY1UUljBMYPtu9BCOrCWKA==", + "version": "6.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", + "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/glob/package-lock.json b/packages/glob/package-lock.json index 02937672fc..8850401606 100644 --- a/packages/glob/package-lock.json +++ b/packages/glob/package-lock.json @@ -58,15 +58,15 @@ } }, "node_modules/brace-expansion": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", - "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "license": "MIT", "dependencies": { "balanced-match": "^4.0.2" }, "engines": { - "node": "18 || 20 || >=22" + "node": "20 || >=22" } }, "node_modules/minimatch": { @@ -94,9 +94,9 @@ } }, "node_modules/undici": { - "version": "6.24.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.24.0.tgz", - "integrity": "sha512-lVLNosgqo5EkGqh5XUDhGfsMSoO8K0BAN0TyJLvwNRSl4xWGZlCVYsAIpa/OpA3TvmnM01GWcoKmc3ZWo5wKKA==", + "version": "6.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", + "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", "license": "MIT", "engines": { "node": ">=18.17" diff --git a/packages/glob/package.json b/packages/glob/package.json index 7e2f940189..92452a9d99 100644 --- a/packages/glob/package.json +++ b/packages/glob/package.json @@ -46,5 +46,8 @@ "dependencies": { "@actions/core": "^3.0.0", "minimatch": "^10.2.5" + }, + "overrides": { + "brace-expansion": "^5.0.12" } } diff --git a/packages/tool-cache/package-lock.json b/packages/tool-cache/package-lock.json index c2245c5b13..bd0f347cba 100644 --- a/packages/tool-cache/package-lock.json +++ b/packages/tool-cache/package-lock.json @@ -141,9 +141,9 @@ } }, "node_modules/undici": { - "version": "6.25.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.25.0.tgz", - "integrity": "sha512-ZgpWDC5gmNiuY9CnLVXEH8rl50xhRCuLNA97fAUnKi8RRuV4E6KG31pDTsLVUKnohJE0I3XDrTeEydAXRw47xg==", + "version": "6.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.0.tgz", + "integrity": "sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==", "license": "MIT", "engines": { "node": ">=18.17" From 8a2ea9b4c5177e3ceef72e45f19a6e4628fc4b46 Mon Sep 17 00:00:00 2001 From: tunc-d <46646394+tunc-d@users.noreply.github.com> Date: Thu, 1 Oct 2026 13:37:19 +0200 Subject: [PATCH 7/8] chore: prepare HTTP-client 4.0.2 consumer minimums Raise dependency floors only for artifact, core and tool-cache. HTTP-client 4.0.2 remains unpublished; preserve real audit-only registry lock entries. The draft is not mergeable until publication and proper consumer lock regeneration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- packages/artifact/package.json | 2 +- packages/core/package.json | 2 +- packages/tool-cache/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/artifact/package.json b/packages/artifact/package.json index 1f0fc59f65..3484aa533d 100644 --- a/packages/artifact/package.json +++ b/packages/artifact/package.json @@ -49,7 +49,7 @@ "dependencies": { "@actions/core": "^3.0.1", "@actions/github": "^9.1.1", - "@actions/http-client": "^4.0.1", + "@actions/http-client": "^4.0.2", "@azure/storage-blob": "^12.31.0", "@octokit/core": "^7.0.6", "@octokit/plugin-request-log": "^6.0.0", diff --git a/packages/core/package.json b/packages/core/package.json index 01f93cd7fa..f86834e97f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -44,7 +44,7 @@ }, "dependencies": { "@actions/exec": "^3.0.0", - "@actions/http-client": "^4.0.0" + "@actions/http-client": "^4.0.2" }, "devDependencies": { "@types/node": "^25.1.0" diff --git a/packages/tool-cache/package.json b/packages/tool-cache/package.json index 4f65484fa1..ef8d1720d1 100644 --- a/packages/tool-cache/package.json +++ b/packages/tool-cache/package.json @@ -45,7 +45,7 @@ "dependencies": { "@actions/core": "^3.0.0", "@actions/exec": "^3.0.0", - "@actions/http-client": "^4.0.0", + "@actions/http-client": "^4.0.2", "@actions/io": "^3.0.0", "semver": "^7.7.3" }, From 7b5ee42e8b5d31bc0ec4da23f86b6f3d8dbecacf Mon Sep 17 00:00:00 2001 From: tunc-d <46646394+tunc-d@users.noreply.github.com> Date: Thu, 1 Oct 2026 16:13:21 +0200 Subject: [PATCH 8/8] ci: trigger fresh checks User-requested fresh CI run with no file changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>