mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
[ci] Reduce number of environment variables we send (#15730)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user