diff --git a/lib/workers/repository/process/index.ts b/lib/workers/repository/process/index.ts index 83da8bc043..5bdfcc85cd 100644 --- a/lib/workers/repository/process/index.ts +++ b/lib/workers/repository/process/index.ts @@ -1,6 +1,5 @@ import { RenovateConfig, mergeChildConfig } from '../../../config'; import { logger } from '../../../logger'; -import { PackageFile } from '../../../manager/common'; import { platform } from '../../../platform'; import { BranchConfig } from '../../common'; import { ExtractResult, extract, update } from './extract-update'; @@ -44,11 +43,13 @@ export async function extractDependencies( } } } + let res: ExtractResult = { + branches: [], + branchList: [], + packageFiles: null, + }; if (config.baseBranches && config.baseBranches.length) { logger.debug({ baseBranches: config.baseBranches }, 'baseBranches'); - let branches: BranchConfig[] = []; - let branchList: string[] = []; - let packageFiles: Record; for (const baseBranch of config.baseBranches) { logger.debug(`baseBranch: ${baseBranch}`); const baseBranchConfig = mergeChildConfig(config, { baseBranch }); @@ -58,14 +59,15 @@ export async function extractDependencies( } baseBranchConfig.baseBranchSha = await platform.setBaseBranch(baseBranch); const baseBranchRes = await extract(baseBranchConfig); - branches = branches.concat(baseBranchRes.branches); - branchList = branchList.concat(baseBranchRes.branchList); - packageFiles = baseBranchRes.packageFiles; + res.branches = res.branches.concat(baseBranchRes.branches); + res.branchList = res.branchList.concat(baseBranchRes.branchList); + res.packageFiles = res.packageFiles || baseBranchRes.packageFiles; // Use the first branch } - return { branches, branchList, packageFiles }; + } else { + logger.debug('No baseBranches'); + res = await extract(config); } - logger.debug('No baseBranches'); - return extract(config); + return res; } export async function updateRepo(