[ci] Reduce number of environment variables we send (#15730)

This commit is contained in:
Jarred Sumner
2024-12-12 17:48:53 -08:00
committed by GitHub
parent e146734596
commit e72692801a

View File

@@ -43,18 +43,27 @@ 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];
}
}
delete bunEnv.NODE_ENV;
@@ -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) {