mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-14 16:46:25 +00:00
53b6050017
Adds config options force and forceCli. These cover the use case where a certain setting is desired to be forced by the bot admin, regardless of repository config, for example removing all configured schedules in order to force PR creation. Closes #1731
20 lines
514 B
JavaScript
20 lines
514 B
JavaScript
const { mergeChildConfig } = require('../../../config');
|
|
|
|
function applyForceConfig(input) {
|
|
let config = { ...input };
|
|
if (config.force && Object.keys(config.force).length) {
|
|
logger.debug('Applying forced config');
|
|
config = mergeChildConfig(config, config.force);
|
|
config.packageRules = config.packageRules || [];
|
|
config.packageRules.push({
|
|
...config.force,
|
|
packagePatterns: ['.*'],
|
|
});
|
|
delete config.force;
|
|
}
|
|
return config;
|
|
}
|
|
|
|
module.exports = {
|
|
applyForceConfig,
|
|
};
|