From 11a558b20a3be401a45e66b9d3565db20f9aaada Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Thu, 15 Jun 2023 10:27:09 +0200
Subject: [PATCH] fix(automerge): allow repeate automerge for groups (#22787)

---
 lib/workers/repository/update/branch/check-existing.spec.ts | 4 ++--
 lib/workers/repository/update/branch/check-existing.ts      | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/workers/repository/update/branch/check-existing.spec.ts b/lib/workers/repository/update/branch/check-existing.spec.ts
index c1f219f22a..a26f611cbc 100644
--- a/lib/workers/repository/update/branch/check-existing.spec.ts
+++ b/lib/workers/repository/update/branch/check-existing.spec.ts
@@ -20,13 +20,13 @@ describe('workers/repository/update/branch/check-existing', () => {
     });
 
     it('returns false if recreating closed PRs', async () => {
-      config.recreateWhen = 'always';
+      config.recreateClosed = true;
       expect(await prAlreadyExisted(config)).toBeNull();
       expect(platform.findPr).toHaveBeenCalledTimes(0);
     });
 
     it('returns false if check misses', async () => {
-      config.recreateWhen = 'auto';
+      config.recreateClosed = false;
       expect(await prAlreadyExisted(config)).toBeNull();
       expect(platform.findPr).toHaveBeenCalledTimes(1);
     });
diff --git a/lib/workers/repository/update/branch/check-existing.ts b/lib/workers/repository/update/branch/check-existing.ts
index c0fdba1154..e0c2bae0f7 100644
--- a/lib/workers/repository/update/branch/check-existing.ts
+++ b/lib/workers/repository/update/branch/check-existing.ts
@@ -8,8 +8,8 @@ export async function prAlreadyExisted(
   config: BranchConfig
 ): Promise<Pr | null> {
   logger.trace({ config }, 'prAlreadyExisted');
-  if (config.recreateWhen === 'always') {
-    logger.debug('recreateWhen is "always". No need to check for closed PR.');
+  if (config.recreateClosed) {
+    logger.debug('recreateClosed is true. No need to check for closed PR.');
     return null;
   }
   logger.debug(
-- 
GitLab