Skip to content

GitHub Enterprise support via configurable API base URL #2

@devblac

Description

@devblac

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

  • Config gains an api_base_url option with default https://api.github.com.
  • CLI wiring passes the configured base URL into github.NewClient.
  • NewClient validates and uses the provided base URL for requests.
  • README includes a short “GitHub Enterprise” setup note.
  • Tests cover loading a custom host and verifying requests target it.
  • Support PRW_API_BASE_URL env var overriding config
     

Hints

Touch internal/config/config.go, cmd/prw/main.go, and internal/github/client.go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    configConfiguration loading, defaults, environment variables, and CLI wiringdocumentationImprovements or additions to documentationenhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions