renovate/lib/workers/repository/init/force.js
Rhys Arkins 53b6050017
feat: force, forceCli (#2145)
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
2018-06-21 10:23:59 +02:00

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,
};