INNER CODE UNIT · TypeScript
log
openai/codex-security · github-action/src/main.ts:94
const log = (message: string): void => {
for (const line of safeLogLines(message)) core.info(line);
};
log(`Target commit: ${target.scannedSha}.${target.diffBase ? ` Diff: ${target.diffBase}..${target.diffHead}.` : ''}`);
if (inputs.paths.length) log(`Paths: ${inputs.paths.join(', ')}.`);
log(`Model: ${inputs.model}; estimated cost stop threshold: ${inputs.maxCost === undefined ? 'unset' : `$${inputs.maxCost}`}; findings failure threshold: ${inputs.failOnSeverity}.`);
const scanLabel = inputs.dryRun ? 'CLI configuration validation' : 'Security scan';
const scanStarted = performance.now();
core.info(`Starting ${scanLabel.toLowerCase()}. CLI diagnostics: ${inputs.verbose ? 'streaming' : 'disabled (verbose: false)'}.`);
timer = heartbeat(scanLabel, scanStarted);
let execution;
try {
execution = await deps.runProcess(runtime.nodePath, [runtime.cliPath, ...args], {
cwd: target.repository, env: inputs.dryRun ? runtimeEnvironment(runtime) : runtime.env(apiKey),
// Stream stderr with terminal controls escaped; structured stdout is consumed below.
log: inputs.verbose ? core.info : undefined,
});
} finally { clearInterval(timer); }