mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 23:16:26 +00:00
b5b714d4b5
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.
29 lines
746 B
JavaScript
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]');
|
|
}
|
|
});
|
|
}
|