Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
adeb21be19 | ||
|
|
335e7624b4 |
@@ -71,7 +71,7 @@ export default async function RunDetailPage({ params }: RunDetailPageProps) {
|
|||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle>{run.scriptName}</CardTitle>
|
<CardTitle>{run.scriptName}</CardTitle>
|
||||||
{script && (
|
{script && (
|
||||||
<CardAction>
|
<CardAction className="row-span-1">
|
||||||
<Link
|
<Link
|
||||||
href={`/scripts/${run.scriptId}?fromRun=${run.id}`}
|
href={`/scripts/${run.scriptId}?fromRun=${run.id}`}
|
||||||
className={buttonVariants({ variant: "outline", size: "sm" })}
|
className={buttonVariants({ variant: "outline", size: "sm" })}
|
||||||
@@ -81,7 +81,7 @@ export default async function RunDetailPage({ params }: RunDetailPageProps) {
|
|||||||
</Link>
|
</Link>
|
||||||
</CardAction>
|
</CardAction>
|
||||||
)}
|
)}
|
||||||
<dl className="text-muted-foreground grid grid-cols-2 gap-x-4 gap-y-2 text-xs sm:grid-cols-3">
|
<dl className="text-muted-foreground col-span-2 grid grid-cols-2 gap-x-4 gap-y-2 text-xs sm:grid-cols-3">
|
||||||
<div>
|
<div>
|
||||||
<dt className="font-mono text-[0.7rem] font-medium tracking-widest uppercase">
|
<dt className="font-mono text-[0.7rem] font-medium tracking-widest uppercase">
|
||||||
Triggered by
|
Triggered by
|
||||||
|
|||||||
@@ -18,6 +18,15 @@ function stringifyValue(value: unknown, joinWith: string): string {
|
|||||||
return String(value);
|
return String(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Quotes a value for the human-readable `redactedCommandLine` display only - the real
|
||||||
|
* invocation always passes values as discrete argv elements/env vars (see build note below),
|
||||||
|
* so this never affects execution. Without it, a value like "Glitz and glam" renders as three
|
||||||
|
* bare words indistinguishable from separate argv entries. */
|
||||||
|
function quoteForDisplay(value: string): string {
|
||||||
|
if (value !== "" && /^[a-zA-Z0-9_@%+=:,./-]+$/.test(value)) return value;
|
||||||
|
return `"${value.replace(/([$`"\\])/g, "\\$1")}"`;
|
||||||
|
}
|
||||||
|
|
||||||
/** Builds an argv-array invocation from validated variable values. Never produces a shell string. */
|
/** Builds an argv-array invocation from validated variable values. Never produces a shell string. */
|
||||||
export function buildInvocation(
|
export function buildInvocation(
|
||||||
script: ScriptConfig,
|
script: ScriptConfig,
|
||||||
@@ -43,7 +52,10 @@ export function buildInvocation(
|
|||||||
const argName = variable.argName!;
|
const argName = variable.argName!;
|
||||||
const value = stringifyValue(raw, variable.joinWith);
|
const value = stringifyValue(raw, variable.joinWith);
|
||||||
argv.push(argName, value);
|
argv.push(argName, value);
|
||||||
redactedArgv.push(argName, variable.secret ? REDACTED : value);
|
redactedArgv.push(
|
||||||
|
argName,
|
||||||
|
variable.secret ? REDACTED : quoteForDisplay(value),
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "flag": {
|
case "flag": {
|
||||||
@@ -57,7 +69,7 @@ export function buildInvocation(
|
|||||||
const value = stringifyValue(raw, variable.joinWith);
|
const value = stringifyValue(raw, variable.joinWith);
|
||||||
env[variable.envName!] = value;
|
env[variable.envName!] = value;
|
||||||
redactedEnvAssignments.push(
|
redactedEnvAssignments.push(
|
||||||
`${variable.envName}=${variable.secret ? REDACTED : value}`,
|
`${variable.envName}=${variable.secret ? REDACTED : quoteForDisplay(value)}`,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user