Skip to content

Conversation

@rmuir
Copy link

@rmuir rmuir commented Sep 5, 2025

Update Copilot HTTP requests and token lookup to respect the GH_HOST env var, allowing use with GitHub Enterprise instances.

Some networks block the github.com endpoints, so they won't work at all. Provide a way for the user to hit different endpoint other than github.com (e.g. mycorp.ghe.com) without patching the source code.

The GH_HOST environment variable is the same one used to override this for gh cli: https://cli.github.com/manual/gh_help_environment

Note: maybe this isn't the best solution, I'm not a lua guy... but I tested it in such a restrictive environment and it works.

Update Copilot HTTP requests and token lookup to respect the `GH_HOST` env var, allowing use with
GitHub Enterprise instances.

Some networks block the `github.com` endpoints, so they won't work at all. Provide a way for the
user to hit different endpoint other than `github.com` (e.g. mycorp.ghe.com) without patching the
source code.

The `GH_HOST` environment variable is the same one used to override this for `gh` cli:
https://cli.github.com/manual/gh_help_environment
@olimorris olimorris added the P4 Negligible impact and urgency label Sep 5, 2025
@rmuir
Copy link
Author

rmuir commented Sep 5, 2025

Maybe a cleaner solution would be to parse out of the oauth rather than looking for github.com, I don't know. ~/.config/github-copilot/apps.json entry looks like this, the mycorp.ghe.com is in there. Could be a better solution than environment variables and "just work" in more cases:

{"mycorp.ghe.com:Xy1.00deadbeef0":{"user":"my-user","oauth_token":"<nope>","githubAppId":"Xy1.00deadbeef0"}}

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2025

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the Stale label Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P4 Negligible impact and urgency Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants