Skip to content
Snippets Groups Projects
Unverified Commit cd57b3e3 authored by Robert Lin's avatar Robert Lin Committed by GitHub
Browse files

fix: do not override config.force with forceCli (#7274)

parent 662a249b
No related branches found
No related tags found
No related merge requests found
// @ts-ignore
module.exports = {
token: 'abcdefg',
logLevel: 'error',
force: {
schedule: null,
}
};
......@@ -61,6 +61,26 @@ describe('config/index', () => {
]);
expect(parsedConfig).not.toContainKey('configFile');
});
it('supports config.force', async () => {
const configPath = path.join(
__dirname,
'config/__fixtures__/withForce.js'
);
const env: NodeJS.ProcessEnv = {
...defaultEnv,
RENOVATE_CONFIG_FILE: configPath,
};
const parsedConfig = await configParser.parseConfigs(env, defaultArgv);
expect(parsedConfig).toContainEntries([
['token', 'abcdefg'],
[
'force',
{
schedule: null,
},
],
]);
});
it('reads private key from file', async () => {
const privateKeyPath = path.join(
__dirname,
......
......@@ -65,7 +65,11 @@ export async function parseConfigs(
}
if (config.forceCli) {
config = mergeChildConfig(config, { force: { ...cliConfig } });
if (config.force) {
config.force = Object.assign(config.force, { ...cliConfig });
} else {
config.force = { ...cliConfig };
}
}
if (!config.privateKey && config.privateKeyPath) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment