diff --git a/lib/platform/gitlab/index.js b/lib/platform/gitlab/index.js index b7eaacac481f22383e96b137e7ef8dd8ca31a9df..337b19d1a2d4411a4a340b63d2ec976b304fd858 100644 --- a/lib/platform/gitlab/index.js +++ b/lib/platform/gitlab/index.js @@ -686,7 +686,7 @@ async function getPr(iid) { logger.debug('pr cannot be merged'); pr.canMerge = false; pr.isConflicted = true; - } else { + } else if (pr.state === 'open') { const branchStatus = await getBranchStatus(pr.branchName, []); if (branchStatus === 'success') { pr.canMerge = true; diff --git a/test/platform/gitlab/__snapshots__/index.spec.js.snap b/test/platform/gitlab/__snapshots__/index.spec.js.snap index 132dc8dae00fb87c27df225c7d281df1895efdd9..971da13226b4e59a21519b2b925e2a0eb09015d7 100644 --- a/test/platform/gitlab/__snapshots__/index.spec.js.snap +++ b/test/platform/gitlab/__snapshots__/index.spec.js.snap @@ -194,7 +194,7 @@ Object { "isStale": false, "number": 91, "source_branch": "some-branch", - "state": undefined, + "state": "open", } `; diff --git a/test/platform/gitlab/index.spec.js b/test/platform/gitlab/index.spec.js index ae9dcbb1b9186e6be171ac5628d5edee99519c59..30b1e6ba73240b8e1e67fc0d62cf72453f91f9b3 100644 --- a/test/platform/gitlab/index.spec.js +++ b/test/platform/gitlab/index.spec.js @@ -327,6 +327,7 @@ describe('platform/gitlab', () => { get.mockReturnValueOnce({ body: { iid: 91, + state: 'opened', additions: 1, deletions: 1, commits: 1,