Skip to content

Commit e1eafbf

Browse files
committed
Fix secrets redacting
1 parent 6e3a098 commit e1eafbf

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/@netlify-build/src/utils/patch-logs.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ function monkeyPatchLogs(secrets) {
1212
}
1313
let prefixSet = false
1414
const redactedArgs = args.map(a => {
15-
// If log is logging error, redact and return stack
16-
if (a instanceof Error) {
17-
return redactValues(a.stack, secrets)
18-
}
19-
2015
const redactedLog = redactValues(a, secrets)
2116
if (typeof a === 'object') {
2217
return util.inspect(redactedLog, {

packages/@netlify-build/src/utils/redact.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ function redactValues(target, secrets) {
1212
return redactEnv.redact(target, secrets)
1313
}
1414

15+
if (target instanceof Error) {
16+
return redactEnv.redact(target.stack, secrets)
17+
}
18+
1519
return mapObj(
1620
target,
1721
(key, value) => [

0 commit comments

Comments
 (0)