diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js index 8e958d3b01..8614091f20 100644 --- a/lib/platform/github/index.js +++ b/lib/platform/github/index.js @@ -404,34 +404,30 @@ async function branchExists(branchName) { async function getAllRenovateBranches(branchPrefix) { logger.trace('getAllRenovateBranches'); - try { - const allBranches = (await get( - `repos/${config.repository}/git/refs/heads/${branchPrefix}`, - { - paginate: true, - } - )).body; - return allBranches.reduce((arr, branch) => { - if (branch.ref.startsWith(`refs/heads/${branchPrefix}`)) { - arr.push(branch.ref.substring('refs/heads/'.length)); - } - if ( - branchPrefix.endsWith('/') && - branch.ref === `refs/heads/${branchPrefix.slice(0, -1)}` - ) { - logger.warn( - `Pruning branch "${branchPrefix.slice( - 0, - -1 - )}" so that it does not block PRs` - ); - arr.push(branch.ref.substring('refs/heads/'.length)); - } - return arr; - }, []); - } catch (err) /* istanbul ignore next */ { - return []; - } + const allBranches = (await get( + `repos/${config.repository}/git/refs/heads/${branchPrefix}`, + { + paginate: true, + } + )).body; + return allBranches.reduce((arr, branch) => { + if (branch.ref.startsWith(`refs/heads/${branchPrefix}`)) { + arr.push(branch.ref.substring('refs/heads/'.length)); + } + if ( + branchPrefix.endsWith('/') && + branch.ref === `refs/heads/${branchPrefix.slice(0, -1)}` + ) { + logger.warn( + `Pruning branch "${branchPrefix.slice( + 0, + -1 + )}" so that it does not block PRs` + ); + arr.push(branch.ref.substring('refs/heads/'.length)); + } + return arr; + }, []); } async function isBranchStale(branchName) {