MCPcopy Create free account
hub / github.com/Noumena-Network/code / subprocessEnv

Function subprocessEnv

src/utils/subprocessEnv.ts:81–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79}
80
81export function subprocessEnv(): NodeJS.ProcessEnv {
82 // CCR upstreamproxy: inject HTTPS_PROXY + CA bundle vars so curl/gh/python
83 // in agent subprocesses route through the local relay. Returns {} when the
84 // proxy is disabled or not registered (non-CCR), so this is a no-op outside
85 // CCR containers.
86 const proxyEnv = _getUpstreamProxyEnv?.() ?? {}
87
88 if (!isEnvTruthy(process.env.CLAUDE_CODE_SUBPROCESS_ENV_SCRUB)) {
89 return Object.keys(proxyEnv).length > 0
90 ? { ...process.env, ...proxyEnv }
91 : process.env
92 }
93 const env = { ...process.env, ...proxyEnv }
94 for (const k of GHA_SUBPROCESS_SCRUB) {
95 delete env[k]
96 // GitHub Actions auto-creates INPUT_<NAME> for `with:` inputs, duplicating
97 // secrets like INPUT_NOUMENA_API_KEY or INPUT_ANTHROPIC_API_KEY. No-op
98 // for vars that aren't action inputs.
99 delete env[`INPUT_${k}`]
100 }
101 return env
102}

Callers 5

execFunction · 0.85
execCommandHookFunction · 0.85
createAndSaveSnapshotFunction · 0.85
startFunction · 0.85
client.tsFile · 0.85

Calls 2

isEnvTruthyFunction · 0.90
keysMethod · 0.80

Tested by

no test coverage detected