MCPcopy
hub / github.com/promptfoo/promptfoo / createSubprocessEnv

Function createSubprocessEnv

code-scan-action/src/main.ts:114–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112] as const;
113
114function createSubprocessEnv(): Record<string, string> {
115 const env = Object.fromEntries(
116 Object.entries(process.env).filter((entry): entry is [string, string] => {
117 return typeof entry[1] === 'string';
118 }),
119 );
120
121 delete env.NPM_CONFIG_BEFORE;
122 delete env.npm_config_before;
123
124 for (const key of SUBPROCESS_ENV_EXCLUSIONS) {
125 delete env[key];
126 }
127
128 return env;
129}
130
131function createScanEnv(oidcToken: string | undefined): Record<string, string> {
132 const env = createSubprocessEnv();

Callers 2

createScanEnvFunction · 0.85
runPromptfooScanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…