From 9cd579ddb345ddcd490d545bd67bbcfa929f667a Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Mon, 12 Feb 2018 07:10:50 +0100
Subject: [PATCH] feat: support separate GHE and github.com tokens

Instead of deleting the GITHUB_TOKEN when we find GHE configured, replace it with GITHUB_COM_TOKEN for the purposes of retrieving release notes and commit history.

Workaround for #1500 but does not close it.
---
 lib/workers/pr/index.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/workers/pr/index.js b/lib/workers/pr/index.js
index ffdd805a6b..1b54c665b8 100644
--- a/lib/workers/pr/index.js
+++ b/lib/workers/pr/index.js
@@ -92,7 +92,7 @@ async function ensurePr(prConfig) {
   if (process.env.GITHUB_ENDPOINT) {
     logger.debug('Removing GHE token before calling changelog');
     token = process.env.GITHUB_TOKEN;
-    delete process.env.GITHUB_TOKEN;
+    process.env.GITHUB_TOKEN = process.env.GITHUB_COM_TOKEN;
   }
   // Get changelog and then generate template strings
   for (const upgrade of upgrades) {
-- 
GitLab