fix(vcs): derive the GitHub web host from the configured API base - #725
Merged
Makisuo merged 1 commit intoSep 1, 2026
Merged
Conversation
`GITHUB_API_BASE_URL` points an installation at GitHub Enterprise, but the two URLs that are not on the API host were hardcoded to `https://github.com`: the App installation redirect, and the OAuth code exchange — which posts the App's client id and secret. An Enterprise deployment therefore sent those credentials to public GitHub and opened an install page for an app that does not exist there. Both now derive the web host from the same setting, stripping the Enterprise Server `/api/v3` suffix and mapping `api.github.com` to `github.com`. An unparseable value falls back to public GitHub, which is the existing default.
Makisuo
force-pushed
the
fix/05-github-enterprise-host
branch
from
September 1, 2026 14:51
3a0eb56 to
27016e9
Compare
🍁 Maple PR previewWarning Preview cleanup could not be confirmed. The Alchemy teardown outcome was Final commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Last of a five-PR stack, based on #724.
GITHUB_API_BASE_URLpoints an installation at GitHub Enterprise, but the two URLs that are not on the API host were hardcoded tohttps://github.com:GithubConnectService.startConnectclient_idandclient_secretAn Enterprise deployment therefore sent those credentials to public GitHub and opened an install page for an app that does not exist there.
Both derive the web host from the same setting now, stripping the Enterprise Server
/api/v3suffix and mappingapi.github.comtogithub.com. An unparseable value falls back to public GitHub, which is the existing default.Tests
github-hosts.test.tscovers public GitHub, the Enterprise suffix, a path-prefixed Enterprise install, and the unparseable fallback.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.