Skip to content

Commit 9799cb0

Browse files
fix(config/parse): merge extends iff additionalConfigFile has extends (renovatebot#37717)
1 parent 6b1d198 commit 9799cb0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/workers/global/config/parse/index.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,5 +337,16 @@ describe('workers/global/config/parse/index', () => {
337337
'customManagers:azurePipelinesVersions',
338338
]);
339339
});
340+
341+
it('adds extends from fileConfig only', async () => {
342+
fileConfigParser.getConfig.mockResolvedValueOnce({
343+
extends: [':pinDigests'],
344+
});
345+
const parsedConfig = await configParser.parseConfigs(
346+
defaultEnv,
347+
defaultArgv,
348+
);
349+
expect(parsedConfig.extends).toMatchObject([':pinDigests']);
350+
});
340351
});
341352
});

lib/workers/global/config/parse/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ export async function parseConfigs(
5050

5151
let config: AllConfig = mergeChildConfig(fileConfig, additionalFileConfig);
5252
// merge extends from file config and additional file config
53-
if (is.nonEmptyArray(fileConfig.extends)) {
53+
if (
54+
is.nonEmptyArray(fileConfig.extends) &&
55+
is.nonEmptyArray(additionalFileConfig.extends)
56+
) {
5457
config.extends = [...fileConfig.extends, ...(config.extends ?? [])];
5558
}
5659
config = mergeChildConfig(config, envConfig);

0 commit comments

Comments
 (0)