From 73f11c09ee7a0c5b2952e028db6bb22c75b312d7 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Fri, 4 Sep 2020 10:55:36 +0200
Subject: [PATCH] refactor: log setBranchStatus url if failing

---
 lib/platform/github/index.ts | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/platform/github/index.ts b/lib/platform/github/index.ts
index 3b6c1a8146..7dc6929ffd 100644
--- a/lib/platform/github/index.ts
+++ b/lib/platform/github/index.ts
@@ -942,9 +942,10 @@ export async function setBranchStatus({
     return;
   }
   logger.debug({ branch: branchName, context, state }, 'Setting branch status');
+  let url: string;
   try {
     const branchCommit = git.getBranchCommit(branchName);
-    const url = `repos/${config.repository}/statuses/${branchCommit}`;
+    url = `repos/${config.repository}/statuses/${branchCommit}`;
     const renovateToGitHubStateMapping = {
       green: 'success',
       yellow: 'pending',
@@ -964,7 +965,7 @@ export async function setBranchStatus({
     await getStatus(branchName, false);
     await getStatusCheck(branchName, false);
   } catch (err) /* istanbul ignore next */ {
-    logger.debug({ err }, 'Caught error setting branch status - aborting');
+    logger.debug({ err, url }, 'Caught error setting branch status - aborting');
     throw new Error(REPOSITORY_CHANGED);
   }
 }
-- 
GitLab