From 12d44364845cf95b2b01b98db840b211bb381362 Mon Sep 17 00:00:00 2001
From: Gautier Pelloux-Prayer <bagage@users.noreply.github.com>
Date: Fri, 8 Mar 2019 15:43:33 +0100
Subject: [PATCH] fix: do not create onboarding branch on dry run (#3333)

This fixes the following scenario:

- on boarding branch is created
- on boarding branch is closed (merged or not) - branch is deleted. So renovate is not configured.
- you relaunch renovate with `--dry-run true`. Then it crashes with:
---
 lib/workers/repository/onboarding/branch/index.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/workers/repository/onboarding/branch/index.js b/lib/workers/repository/onboarding/branch/index.js
index 48e2a260d3..88a9b1db21 100644
--- a/lib/workers/repository/onboarding/branch/index.js
+++ b/lib/workers/repository/onboarding/branch/index.js
@@ -27,7 +27,9 @@ async function checkOnboardingBranch(config) {
     logger.info('Need to create onboarding PR');
     await createOnboardingBranch(config);
   }
-  await platform.setBaseBranch(onboardingBranch);
+  if (!config.dryRun) {
+    await platform.setBaseBranch(onboardingBranch);
+  }
   const branchList = [onboardingBranch];
   return { ...config, repoIsOnboarded, branchList };
 }
-- 
GitLab