Show env-passed variables in the displayed run command line
redactedCommandLine only ever included argv (script.command + args), so a passAs:env variable like a scene name was invisible in run history even though it's the main thing that varied between runs. Secrets still redact to *** instead of being omitted outright.
This commit is contained in:
@@ -26,6 +26,7 @@ export function buildInvocation(
|
||||
const argv = [...script.args];
|
||||
const env: Record<string, string> = {};
|
||||
const redactedArgv = [...script.args];
|
||||
const redactedEnvAssignments: string[] = [];
|
||||
const redactedVariables: Record<string, unknown> = {};
|
||||
|
||||
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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user