Skip to content

Commit 6906f35

Browse files
committed
Add Support for on-premise GitHub deployments
1 parent 5a1bc8d commit 6906f35

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ The following environment variables are expected. If a `.env` file is present,
3333
# Hostname of your Jira instance.
3434
JIRA_URL=unicode-org.atlassian.net
3535
36+
# Hostname of your GitHub instance
37+
GITHUB_URL=https://github.mycompany.com/api/v3
38+
3639
# Authentication for your Jira instance.
3740
# If not present, authentication for Jira will not be used.
3841
#

src/github-status.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,17 @@ async function getAuthenticatedOctokitClient(token) {
1515
throw new Error("Need either GITHUB_TOKEN or GITHUB_APP_ID");
1616
}
1717
}
18+
19+
let github_url;
20+
if (process.env.GITHUB_URL) {
21+
github_url = process.env.GITHUB_URL;
22+
} else {
23+
github_url = "https://api.github.com";
24+
}
25+
1826
return new Octokit({
19-
auth: token
27+
auth: token,
28+
baseUrl: github_url
2029
});
2130
}
2231

0 commit comments

Comments
 (0)