renovate/lib/logger/config-serializer.js
Rhys Arkins b5b714d4b5
fix: writeToken -> forkToken (#1295)
Rename writeToken to forkToken to make it clearer. This enables GitHub API to use one token for all reads, and another token just for writing to the forked repository.
2017-12-14 11:47:00 +01:00

29 lines
746 B
JavaScript

const traverse = require('traverse');
module.exports = configSerializer;
function configSerializer(config) {
const redactedFields = [
'token',
'githubAppKey',
'npmToken',
'npmrc',
'yarnrc',
'privateKey',
'gitPrivateKey',
'forkToken',
];
const templateFields = ['commitMessage', 'prTitle', 'prBody'];
// eslint-disable-next-line array-callback-return
return traverse(config).map(function scrub(val) {
if (val && redactedFields.indexOf(this.key) !== -1) {
this.update('***********');
}
if (val && templateFields.indexOf(this.key) !== -1) {
this.update('[Template]');
}
if (this.key === 'content' || this.key === 'contents') {
this.update('[content]');
}
});
}