Skip to content

Commit

Permalink
fix: ensure packageFiles isn't null during dependency extraction (#32570
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Churro authored Nov 16, 2024
1 parent 9b45b6b commit ebdf819
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/workers/repository/process/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export async function extractDependencies(
let res: ExtractResult = {
branches: [],
branchList: [],
packageFiles: null!,
packageFiles: {},
};
if (GlobalConfig.get('platform') !== 'local' && config.baseBranches?.length) {
config.baseBranches = unfoldBaseBranches(
Expand All @@ -146,7 +146,10 @@ export async function extractDependencies(
const baseBranchRes = await lookup(baseBranchConfig, 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
if (!res.packageFiles || !Object.keys(res.packageFiles).length) {
// Use the first branch
res.packageFiles = baseBranchRes?.packageFiles;
}
}
}
removeMeta(['baseBranch']);
Expand Down

0 comments on commit ebdf819

Please sign in to comment.