diff --git a/core/context/providers/GitHubIssuesContextProvider.ts b/core/context/providers/GitHubIssuesContextProvider.ts index c0f25c12b..ef34ad621 100644 --- a/core/context/providers/GitHubIssuesContextProvider.ts +++ b/core/context/providers/GitHubIssuesContextProvider.ts @@ -21,9 +21,11 @@ class GitHubIssuesContextProvider extends BaseContextProvider { ): Promise { const issueId = query; const { Octokit } = await import("@octokit/rest"); + const domain = this.options?.domain ?? "github.com"; const octokit = new Octokit({ auth: this.options?.githubToken, + baseUrl: `https://${domain}/api/v3`, request: { fetch: extras.fetch, }, diff --git a/docs/docs/customization/context-providers.md b/docs/docs/customization/context-providers.md index 7dfe6190c..39c972ae7 100644 --- a/docs/docs/customization/context-providers.md +++ b/docs/docs/customization/context-providers.md @@ -138,6 +138,26 @@ Type '@issue' to reference the conversation in a GitHub issue. Make sure to incl } ``` +#### Using Github Enterprise Server + +When using with Github Enterprise Server, you can set the `domain` parameter to your server's hostname. By default this is set to `github.com`. + +```json +{ + "name": "issue", + "params": { + "repos": [ + { + "owner": "continuedev", + "repo": "continue" + } + ], + "githubToken": "ghp_xxx", + "domain": "github.acme-inc.com" + } +} +``` + ### GitLab Merge Request Type `@gitlab-mr` to reference an open MR for this branch on GitLab.