MCPcopy Create free account
hub / github.com/github/gh-aw / buildCodexChildEnv

Function buildCodexChildEnv

actions/setup/js/codex_harness.cjs:247–256  ·  view source on GitHub ↗

* Build child process environment for Codex execution. * Preserve API keys captured at harness startup, even if the parent environment * is sanitized later in the run. * * @param {NodeJS.ProcessEnv} baseEnv * @param {string|undefined} codexApiKey * @param {string|undefined} openaiApiKey * @re

(baseEnv, codexApiKey, openaiApiKey)

Source from the content-addressed store, hash-verified

245 * @returns {NodeJS.ProcessEnv}
246 */
247function buildCodexChildEnv(baseEnv, codexApiKey, openaiApiKey) {
248 const childEnv = { ...baseEnv };
249 if (codexApiKey) {
250 childEnv.CODEX_API_KEY = codexApiKey;
251 }
252 if (openaiApiKey) {
253 childEnv.OPENAI_API_KEY = openaiApiKey;
254 }
255 return childEnv;
256}
257
258/**
259 * Extract numeric port from a URL string.

Callers 2

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected