Skip to content
Snippets Groups Projects
Commit 7021a073 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix: clean up multiple baseBranches correctly

Re-enables branch cleanup for multiple baseBranches
parent 3d65e3a4
No related branches found
No related tags found
No related merge requests found
......@@ -3,10 +3,6 @@ module.exports = {
};
async function pruneStaleBranches(config) {
// istanbul ignore if
if (config.baseBranches && config.baseBranches.length) {
return;
}
// TODO: try/catch
const { branchList } = config;
logger.debug('Removing any stale branches');
......@@ -46,7 +42,7 @@ async function pruneStaleBranches(config) {
return;
}
for (const branchName of remainingBranches) {
logger.debug({ branch: branchName }, `Deleting orphan branch`);
logger.info({ branch: branchName }, `Deleting orphan branch`);
const pr = await platform.findPr(branchName, null, 'open');
if (pr) {
logger.info({ prNo: pr.number, prTitle: pr.title }, 'Autoclosing PR');
......
......@@ -50,6 +50,8 @@ async function renovateRepository(repoConfig, token, loop = 1) {
config.branches = config.branches.concat(res.branches);
}
}
// istanbul ignore next
config.branchList = config.branches.map(branch => branch.branchName);
} else {
config = await resolvePackageFiles(config);
config = await determineUpdates(config);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment