From 40343d71fa06fd6db889d2d89cdab5836d4ffcf8 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Mon, 11 Oct 2021 08:54:07 +0200
Subject: [PATCH] fix(git): detect github force push rejection (#12108)

---
 lib/util/git/index.ts | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts
index 509226ef9d..96fa264a5f 100644
--- a/lib/util/git/index.ts
+++ b/lib/util/git/index.ts
@@ -850,7 +850,10 @@ export async function commitFiles({
       );
       return null;
     }
-    if (err.message.includes('denying non-fast-forward')) {
+    if (
+      err.message.includes('denying non-fast-forward') ||
+      err.message.includes('GH003: Sorry, force-pushing')
+    ) {
       logger.debug({ err }, 'Permission denied to update branch');
       const error = new Error(CONFIG_VALIDATION);
       error.validationSource = branchName;
-- 
GitLab