GitHub Enterprise support via configurable API base URL
Context
I tried pointing prw at a GitHub Enterprise host and realized the client is hardwired to https://api.github.com, so nothing worked.
Problem
NewClient ignores any host override; config/CLI don’t expose an API base URL, so requests always go to GitHub.com.
Expected behavior
I can set an API base URL via config, with an optional PRW_API_BASE_URL env var override that defaults to https://api.github.com, and the client uses it for all requests after basic validation.
Scope / non-goals
- No fancy host auto-discovery.
- Keep defaults unchanged for GitHub.com users.
- Only add the minimal validation to avoid malformed URLs.
Acceptance criteria
Hints
Touch internal/config/config.go, cmd/prw/main.go, and internal/github/client.go.
GitHub Enterprise support via configurable API base URL
Context
I tried pointing
prwat a GitHub Enterprise host and realized the client is hardwired tohttps://api.github.com, so nothing worked.Problem
NewClientignores any host override; config/CLI don’t expose an API base URL, so requests always go to GitHub.com.Expected behavior
I can set an API base URL via config, with an optional PRW_API_BASE_URL env var override that defaults to
https://api.github.com, and the client uses it for all requests after basic validation.Scope / non-goals
Acceptance criteria
api_base_urloption with defaulthttps://api.github.com.github.NewClient.NewClientvalidates and uses the provided base URL for requests.PRW_API_BASE_URLenv var overriding configHints
Touch
internal/config/config.go,cmd/prw/main.go, andinternal/github/client.go.