From e02e816e5591415258a53bf735aff57977dcd5e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 14:40:33 -0700 Subject: [PATCH] build(deps-dev): bump undici from 7.24.6 to 8.2.0 (#366) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [undici](https://github.com/nodejs/undici) from 7.24.6 to 8.2.0.
Release notes

Sourced from undici's releases.

v8.2.0

What's Changed

... (truncated)

Commits

--------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Parker Brown <17183625+parkerbxyz@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- package-lock.json | 10 +++++----- package.json | 2 +- tests/index.js | 8 +++++++- tests/main.js | 6 ++---- tests/mock-agent.js | 12 ++++++++++++ tests/post-revoke-token-fail-response.test.js | 6 ++---- tests/post-token-expired.test.js | 6 ++---- tests/post-token-set.test.js | 6 ++---- tests/post-token-skipped.test.js | 6 ++---- 9 files changed, 35 insertions(+), 27 deletions(-) create mode 100644 tests/mock-agent.js diff --git a/package-lock.json b/package-lock.json index 46e6b4b..fca2c7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "c8": "^11.0.0", "esbuild": "^0.28.0", "open-cli": "^9.0.0", - "undici": "^7.24.6", + "undici": "^8.2.0", "yaml": "^2.8.3" }, "engines": { @@ -1786,13 +1786,13 @@ } }, "node_modules/undici": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.24.6.tgz", - "integrity": "sha512-Xi4agocCbRzt0yYMZGMA6ApD7gvtUFaxm4ZmeacWI4cZxaF6C+8I8QfofC20NAePiB/IcvZmzkJ7XPa471AEtA==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-8.2.0.tgz", + "integrity": "sha512-Z+4Hx9GE26Lh9Upwfnc8C7SsrpBPGaM/Gm6kMFtiG7c+5IvQKlXi/t+9x9DrrCh29cww5TSP9YdVaBcnLDs5fQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=20.18.1" + "node": ">=22.19.0" } }, "node_modules/unique-string": { diff --git a/package.json b/package.json index e3d3154..c616cfe 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "c8": "^11.0.0", "esbuild": "^0.28.0", "open-cli": "^9.0.0", - "undici": "^7.24.6", + "undici": "^8.2.0", "yaml": "^2.8.3" } } diff --git a/tests/index.js b/tests/index.js index 74cf272..159c21c 100644 --- a/tests/index.js +++ b/tests/index.js @@ -22,7 +22,13 @@ function normalizeStderr(stderr) { const files = readdirSync("tests"); // Files to ignore -const ignore = ["index.js", "index.js.snapshot", "main.js", "README.md"]; +const ignore = [ + "index.js", + "index.js.snapshot", + "main.js", + "mock-agent.js", + "README.md", +]; const testFiles = files.filter((file) => !ignore.includes(file)).sort(); diff --git a/tests/main.js b/tests/main.js index a76c39a..1edc643 100644 --- a/tests/main.js +++ b/tests/main.js @@ -1,6 +1,6 @@ // Base for all `main` tests. // @ts-check -import { MockAgent, setGlobalDispatcher } from "undici"; +import { createMockAgent } from "./mock-agent.js"; export const DEFAULT_ENV = { GITHUB_REPOSITORY_OWNER: "actions", @@ -50,9 +50,7 @@ export async function test(cb = (_mockPool) => {}, env = DEFAULT_ENV) { // Set up mocking const baseUrl = new URL(env["INPUT_GITHUB-API-URL"]); const basePath = baseUrl.pathname === "/" ? "" : baseUrl.pathname; - const mockAgent = new MockAgent({ enableCallHistory: true }); - mockAgent.disableNetConnect(); - setGlobalDispatcher(mockAgent); + const mockAgent = createMockAgent({ enableCallHistory: true }); const mockPool = mockAgent.get(baseUrl.origin); // Calling `auth({ type: "app" })` to obtain a JWT doesn’t make network requests, so no need to intercept. diff --git a/tests/mock-agent.js b/tests/mock-agent.js new file mode 100644 index 0000000..fb93d50 --- /dev/null +++ b/tests/mock-agent.js @@ -0,0 +1,12 @@ +import { install, MockAgent, setGlobalDispatcher } from "undici"; + +// Ensure MockAgent intercepts requests made through global fetch. +install(); + +export function createMockAgent(options) { + const mockAgent = new MockAgent(options); + mockAgent.disableNetConnect(); + setGlobalDispatcher(mockAgent); + + return mockAgent; +} diff --git a/tests/post-revoke-token-fail-response.test.js b/tests/post-revoke-token-fail-response.test.js index b729b55..6318182 100644 --- a/tests/post-revoke-token-fail-response.test.js +++ b/tests/post-revoke-token-fail-response.test.js @@ -1,4 +1,4 @@ -import { MockAgent, setGlobalDispatcher } from "undici"; +import { createMockAgent } from "./mock-agent.js"; // state variables are set as environment variables with the prefix STATE_ // https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#sending-values-to-the-pre-and-post-actions @@ -14,9 +14,7 @@ process.env.STATE_expiresAt = new Date( Date.now() + 1000 * 60 * 60 ).toISOString(); -const mockAgent = new MockAgent(); - -setGlobalDispatcher(mockAgent); +const mockAgent = createMockAgent(); // Provide the base url to the request const mockPool = mockAgent.get("https://api.github.com"); diff --git a/tests/post-token-expired.test.js b/tests/post-token-expired.test.js index 62caa6d..beae3f2 100644 --- a/tests/post-token-expired.test.js +++ b/tests/post-token-expired.test.js @@ -1,4 +1,4 @@ -import { MockAgent, setGlobalDispatcher } from "undici"; +import { createMockAgent } from "./mock-agent.js"; // state variables are set as environment variables with the prefix STATE_ // https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#sending-values-to-the-pre-and-post-actions @@ -11,9 +11,7 @@ process.env.STATE_expiresAt = new Date(Date.now() - 1000 * 60 * 60).toISOString( // https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs process.env["INPUT_SKIP-TOKEN-REVOKE"] = "false"; -const mockAgent = new MockAgent(); - -setGlobalDispatcher(mockAgent); +const mockAgent = createMockAgent(); // Provide the base url to the request const mockPool = mockAgent.get("https://api.github.com"); diff --git a/tests/post-token-set.test.js b/tests/post-token-set.test.js index 8ae8c36..c90b437 100644 --- a/tests/post-token-set.test.js +++ b/tests/post-token-set.test.js @@ -1,4 +1,4 @@ -import { MockAgent, setGlobalDispatcher } from "undici"; +import { createMockAgent } from "./mock-agent.js"; // state variables are set as environment variables with the prefix STATE_ // https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#sending-values-to-the-pre-and-post-actions @@ -12,9 +12,7 @@ process.env["INPUT_SKIP-TOKEN-REVOKE"] = "false"; // 1 hour in the future, not expired process.env.STATE_expiresAt = new Date(Date.now() + 1000 * 60 * 60).toISOString(); -const mockAgent = new MockAgent(); - -setGlobalDispatcher(mockAgent); +const mockAgent = createMockAgent(); // Provide the base url to the request const mockPool = mockAgent.get("https://api.github.com"); diff --git a/tests/post-token-skipped.test.js b/tests/post-token-skipped.test.js index f756052..7c40d5b 100644 --- a/tests/post-token-skipped.test.js +++ b/tests/post-token-skipped.test.js @@ -1,4 +1,4 @@ -import { MockAgent, setGlobalDispatcher } from "undici"; +import { createMockAgent } from "./mock-agent.js"; // state variables are set as environment variables with the prefix STATE_ // https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#sending-values-to-the-pre-and-post-actions @@ -8,9 +8,7 @@ process.env.STATE_token = "secret123"; // https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs process.env["INPUT_SKIP-TOKEN-REVOKE"] = "true"; -const mockAgent = new MockAgent(); - -setGlobalDispatcher(mockAgent); +const mockAgent = createMockAgent(); // Provide the base url to the request const mockPool = mockAgent.get("https://api.github.com");