Skip to content

Commit

Permalink
fix: make hide-sensitive exceptions more readable
Browse files Browse the repository at this point in the history
Co-authored-by: Gregor Martynus <gregor@martynus.net>
  • Loading branch information
nickshine and gr2m committed May 24, 2020
1 parent c98ae38 commit 0fe916c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/hide-sensitive.js
Expand Up @@ -3,8 +3,14 @@ const {SECRET_REPLACEMENT, SECRET_MIN_SIZE} = require('./definitions/constants')

module.exports = (env) => {
const toReplace = Object.keys(env).filter(
(envVar) =>
/token|password|credential|secret|(?<!^go)private/i.test(envVar) && size(env[envVar].trim()) >= SECRET_MIN_SIZE
(envVar) => {
// https://github.com/semantic-release/semantic-release/issues/1558
if (envVar === 'GOPRIVATE') {
return false
}

return /token|password|credential|secret|private/i.test(envVar) && size(env[envVar].trim()) >= SECRET_MIN_SIZE
}
);

const regexp = new RegExp(toReplace.map((envVar) => escapeRegExp(env[envVar])).join('|'), 'g');
Expand Down

0 comments on commit 0fe916c

Please sign in to comment.