MCPcopy Create free account
hub / github.com/oboard/claude-code-rev / subprocessEnv

Function subprocessEnv

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

Source from the content-addressed store, hash-verified

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

Callers 5

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

Calls 3

isEnvTruthyFunction · 0.85
keysMethod · 0.80

Tested by

no test coverage detected