Skip to content

Commit

Permalink
[ci] Reduce number of environment variables we send (#15730)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner authored Dec 13, 2024
1 parent e146734 commit e726928
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit e726928

Please sign in to comment.