From f70c1fe749f5485a54a51c20c51a13b83e7dd7d9 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Sun, 18 Mar 2018 07:04:56 +0100
Subject: [PATCH] fix: move mirrorMode branch creation into initRepo

---
 lib/platform/github/index.js | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js
index 6f8b494bab..f447fc5079 100644
--- a/lib/platform/github/index.js
+++ b/lib/platform/github/index.js
@@ -232,6 +232,9 @@ async function initRepo({
         }
       );
     }
+    if (!await branchExists('renovate-config')) {
+      await createBranch('renovate-config', config.baseCommitSHA);
+    }
   }
   return platformConfig;
 }
@@ -769,10 +772,6 @@ async function createPr(
   // istanbul ignore if
   if (config.mirrorMode && branchName === 'renovate/configure') {
     logger.debug('Using renovate-config as base branch for mirror config');
-    if (!await branchExists('renovate-config')) {
-      const baseCommitSHA = await getBaseCommitSHA();
-      await createBranch('renovate-config', baseCommitSHA);
-    }
     base = 'renovate-config';
   }
   // Include the repository owner to handle forkMode and regular mode
-- 
GitLab