Skip to content

Commit

Permalink
feat: support GitHub Enterprise (#62)
Browse files Browse the repository at this point in the history
GitHub Actions sets the environment variable GITHUB_API_URL to the API
URL of the instance of GitHub.  For example, if running on github.com,
then GITHUB_API_URL will be https://api.github.com; if running on
ghe.my-company.com, then GITHUB_API_URL will be https://ghe.my-company.com/api/v3.

By setting the baseUrl of Octokit to the GITHUB_API_URL environment
variable, any instance of GitHub Actions is supported, github.com or
GitHub Enterprise.
  • Loading branch information
zachwhaley authored Jul 17, 2024
1 parent f2bc5f2 commit 66cb6b2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export class OctokitGitHub {
constructor(githubToken: string) {
Octokit.plugin(require("@octokit/plugin-throttling"));
this.octokit = new Octokit({
baseUrl: process.env["GITHUB_API_URL"] || "https://api.github.com",
auth: githubToken,
throttle: {
onRateLimit: (retryAfter, options) => {
Expand Down

0 comments on commit 66cb6b2

Please sign in to comment.