Skip to content
Snippets Groups Projects
Unverified Commit ac7d8ea1 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix: resolve repoConfig.extends with repo config (#7541)

parent 87533860
No related branches found
No related tags found
No related merge requests found
......@@ -121,6 +121,7 @@ describe('workers/repository/init/config', () => {
warnings: [],
errors: [],
});
config.extends = [':automergeDisabled'];
expect(await mergeRenovateConfig(config)).not.toBeUndefined();
});
});
......
import path from 'path';
import is from '@sindresorhus/is';
import jsonValidator from 'json-dup-key-validator';
import JSON5 from 'json5';
......@@ -149,11 +150,16 @@ export async function mergeRenovateConfig(
): Promise<RenovateConfig> {
let returnConfig = { ...config };
const repoConfig = await detectRepoFileConfig();
const configFileParsed = repoConfig?.configFileParsed || {};
if (is.nonEmptyArray(returnConfig.extends)) {
configFileParsed.extends = [
...returnConfig.extends,
...(configFileParsed.extends || []),
];
delete returnConfig.extends;
}
checkForRepoConfigError(repoConfig);
const migratedConfig = await migrateAndValidate(
config,
repoConfig?.configFileParsed || {}
);
const migratedConfig = await migrateAndValidate(config, configFileParsed);
if (migratedConfig.errors.length) {
const error = new Error(CONFIG_VALIDATION);
error.configFile = repoConfig.configFileName;
......
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