From 7d17c4cb64e3dfd805a5c7c828eda6eec4055e9c Mon Sep 17 00:00:00 2001 From: Adam Bratin Date: Fri, 18 Oct 2019 15:06:14 -0700 Subject: [PATCH] - add support for GHE in github checks integration --- source/platforms/github/comms/checks/githubAppSupport.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/platforms/github/comms/checks/githubAppSupport.ts b/source/platforms/github/comms/checks/githubAppSupport.ts index c038f1055..8b8356749 100644 --- a/source/platforms/github/comms/checks/githubAppSupport.ts +++ b/source/platforms/github/comms/checks/githubAppSupport.ts @@ -20,7 +20,10 @@ const jwtForGitHubAuth = (appID: string, key: string) => { // Step 2 - Use App signed JWT to grab a per-installation const requestAccessTokenForInstallation = (appID: string, installationID: number, key: string) => { - const url = `https://api.github.com/installations/${installationID}/access_tokens` + const apiUrl = process.env["DANGER_GITHUB_API_BASE_URL"] + ? process.env["DANGER_GITHUB_API_BASE_URL"] + : "https://api.github.com" + const url = `${apiUrl}/installations/${installationID}/access_tokens` const headers = { Accept: "application/vnd.github.machine-man-preview+json", Authorization: `Bearer ${jwtForGitHubAuth(appID, key)}`,