diff --git a/src/lib/runner/build-args.ts b/src/lib/runner/build-args.ts index 9f47675..a1d9238 100644 --- a/src/lib/runner/build-args.ts +++ b/src/lib/runner/build-args.ts @@ -26,6 +26,7 @@ export function buildInvocation( const argv = [...script.args]; const env: Record = {}; const redactedArgv = [...script.args]; + const redactedEnvAssignments: string[] = []; const redactedVariables: Record = {}; for (const variable of script.variables) { @@ -55,6 +56,9 @@ export function buildInvocation( case "env": { const value = stringifyValue(raw, variable.joinWith); env[variable.envName!] = value; + redactedEnvAssignments.push( + `${variable.envName}=${variable.secret ? REDACTED : value}`, + ); break; } case "stdin": { @@ -74,7 +78,11 @@ export function buildInvocation( ) : undefined; - const redactedCommandLine = [script.command, ...redactedArgv].join(" "); + const redactedCommandLine = [ + ...redactedEnvAssignments, + script.command, + ...redactedArgv, + ].join(" "); return { argv, env, stdin, redactedVariables, redactedCommandLine }; }