From e72692801a5769ce4379af759d59ec5bea3df80c Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Thu, 12 Dec 2024 17:48:53 -0800 Subject: [PATCH] [ci] Reduce number of environment variables we send (#15730) --- test/harness.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/harness.ts b/test/harness.ts index eb55b7b6820454..27a2bd0911eccf 100644 --- a/test/harness.ts +++ b/test/harness.ts @@ -43,17 +43,26 @@ export const bunEnv: NodeJS.ProcessEnv = { BUN_FEATURE_FLAG_EXPERIMENTAL_BAKE: "1", }; +const ciEnv = { ...bunEnv }; + if (isWindows) { bunEnv.SHELLOPTS = "igncr"; // Ignore carriage return } for (let key in bunEnv) { if (bunEnv[key] === undefined) { + delete ciEnv[key]; delete bunEnv[key]; } if (key.startsWith("BUN_DEBUG_") && key !== "BUN_DEBUG_QUIET_LOGS") { + delete ciEnv[key]; + delete bunEnv[key]; + } + + if (key.startsWith("BUILDKITE")) { delete bunEnv[key]; + delete process.env[key]; } } @@ -1322,6 +1331,7 @@ export function getSecret(name: string): string | undefined { const { exitCode, stdout } = spawnSync({ cmd: ["buildkite-agent", "secret", "get", name], stdout: "pipe", + env: ciEnv, stderr: "inherit", }); if (exitCode === 0) {