feat: hide sensitive info in stdout/sdtin
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
const {escapeRegExp} = require('lodash');
|
||||
|
||||
const regexp = new RegExp(
|
||||
Object.keys(process.env)
|
||||
.filter(envVar => /token|password|credential|secret|private/i.test(envVar))
|
||||
.map(envVar => escapeRegExp(process.env[envVar]))
|
||||
.join('|'),
|
||||
'g'
|
||||
);
|
||||
|
||||
module.exports = output => output.replace(regexp, '[secure]');
|
||||
Reference in New Issue
Block a user