diff --git a/src/commands/template.ts b/src/commands/template.ts index b8bb9ae..0be7c5d 100644 --- a/src/commands/template.ts +++ b/src/commands/template.ts @@ -142,12 +142,19 @@ export function parseSetFlags(pairs: string[]): Record { const values: Record = {} for (const pair of pairs) { const m = /^([A-Z][A-Z0-9_]{0,63})=([\s\S]*)$/.exec(pair) - if (!m) throw new Error(`--set expects NAME=value (NAME matching ^[A-Z][A-Z0-9_]{0,63}$), got: ${pair}`) + if (!m) throw new Error(`--set expects NAME=value (NAME matching ^[A-Z][A-Z0-9_]{0,63}$), got: ${redactSetPair(pair)}`) values[m[1]!] = m[2]! } return values } +// --set carries secrets and this error reaches stderr and CI logs, so only the name is ever shown. +function redactSetPair(pair: string): string { + const eq = pair.indexOf('=') + // Nothing of a pair with no `=`: it was never split, so the whole token may be the value itself. + return eq >= 0 ? `${pair.slice(0, eq)}=