From 6c8e796cb1fe8cc74e021d4bd16d8fb4f4d0091c Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Mon, 29 Oct 2018 06:32:20 +0100 Subject: [PATCH] fix(github): skip branch status checks if pr.canMerge=true --- lib/workers/pr/index.js | 10 ---------- test/workers/pr/index.spec.js | 2 ++ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/workers/pr/index.js b/lib/workers/pr/index.js index 0903b0e315..ac667a63f5 100644 --- a/lib/workers/pr/index.js +++ b/lib/workers/pr/index.js @@ -377,16 +377,6 @@ async function checkAutoMerge(pr, config) { logger.info('PR is not ready for merge'); return false; } - // Check branch status - const branchStatus = await platform.getBranchStatus( - pr.branchName, - requiredStatusChecks - ); - logger.debug(`branchStatus=${branchStatus}`); - if (branchStatus !== 'success') { - logger.debug('Branch status is not "success"'); - return false; - } // Check if it's been touched if (!pr.canRebase) { logger.info('PR is ready for automerge but has been modified'); diff --git a/test/workers/pr/index.spec.js b/test/workers/pr/index.spec.js index a76469de26..4e6d831416 100644 --- a/test/workers/pr/index.spec.js +++ b/test/workers/pr/index.spec.js @@ -124,6 +124,8 @@ describe('workers/pr', () => { platform.createPr.mockReturnValue({ displayNumber: 'New Pull Request' }); config.upgrades = [config]; platform.getPrBody = jest.fn(input => input); + platform.getBranchPr = jest.fn(); + platform.getBranchStatus = jest.fn(); }); afterEach(() => { jest.clearAllMocks(); -- GitLab