From a9179e055862d4bf20301d1eb3d7235dbf774594 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Fri, 26 May 2023 07:57:39 +0200
Subject: [PATCH] fix(github): stop trying automerge if code owner review
 required (#22167)

---
 lib/modules/platform/github/index.spec.ts | 3 +--
 lib/modules/platform/github/index.ts      | 3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/modules/platform/github/index.spec.ts b/lib/modules/platform/github/index.spec.ts
index da1f9e060b..12967fcd9f 100644
--- a/lib/modules/platform/github/index.spec.ts
+++ b/lib/modules/platform/github/index.spec.ts
@@ -2856,8 +2856,7 @@ describe('modules/platform/github/index', () => {
       const scope = httpMock.scope(githubApiHost);
       initRepoMock(scope, 'some/repo');
       scope.put('/repos/some/repo/pulls/1234/merge').reply(405, {
-        message:
-          'At least 1 approving review is required by reviewers with write access.',
+        message: 'Waiting on code owner review from org/team.',
       });
       await github.initRepo({ repository: 'some/repo' });
       const pr = {
diff --git a/lib/modules/platform/github/index.ts b/lib/modules/platform/github/index.ts
index f97787372c..2126664852 100644
--- a/lib/modules/platform/github/index.ts
+++ b/lib/modules/platform/github/index.ts
@@ -1652,7 +1652,8 @@ export async function mergePr({
         }
         if (
           is.nonEmptyString(body?.message) &&
-          body.message.includes('approving review')
+          (body.message.includes('approving review') ||
+            body.message.includes('code owner review'))
         ) {
           logger.debug(
             { response: body },
-- 
GitLab