diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js index 2c76964f6d1e969c339d858a59748d1b4edacf1a..ab8bfe9f24c5d87c20e76cecd2c0cc43a9b6cbce 100644 --- a/lib/platform/github/index.js +++ b/lib/platform/github/index.js @@ -482,7 +482,9 @@ async function ensureCommentRemoval(issueNo, topic) { // Pull Request async function getPrList() { + logger.debug('getPrList()'); if (!config.prList) { + logger.debug('Retrieving PR list'); const res = await get( `repos/${config.repoName}/pulls?per_page=100&state=all`, { paginate: true } @@ -501,12 +503,16 @@ async function getPrList() { async function findPr(branchName, prTitle, state = 'all') { logger.debug(`findPr(${branchName}, ${prTitle}, ${state})`); const prList = await getPrList(); - return prList.find( + const pr = prList.find( p => p.branchName === branchName && (!prTitle || p.title === prTitle) && (state === 'all' || p.state === state) ); + if (pr) { + logger.debug(`Found PR #${pr.number}`); + } + return pr; } // Creates PR and returns PR number