Skip to content

Support GitHub Enterprise Server (custom hosts) in Forge #364

Description

@bearylabs

Currently selectForgeType() in src/forge/index.ts only matches github.com:

function selectForgeType(remoteUrl: string): GetForgeState | undefined { if (remoteUrl.includes('github.com')) {
    return getGithubForgeState; } return;
}

This means Forge (PRs/issues) silently does nothing for repos hosted on GitHub Enterprise Server / GHE.com domains (e.g.  mycompany.ghe.com ), even with  Forge-enabled  on.

Request: Add a setting, e.g.  magit.forgeCustomHosts , accepting a comma-separated list of additional GitHub hostnames.  selectForgeType  should also match these.  getGithubForgeState  would need to:

• derive owner/repo using the matched host instead of a hardcoded  github.com  string
• hit  https://<host>/api/graphql  instead of  https://api.github.com/graphql  for non-github.com hosts
• use GH CLI auth ( gh auth token ) for these hosts since  vscode.authentication 's built-in GitHub provider won't cover custom hosts

Happy to submit a PR for this if that approach sounds reasonable, let me know if you'd want it structured differently.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions