fix(cli): honor GitHub API base URL during sync

This commit is contained in:
Peter Steinberger 2026-04-30 04:48:32 +01:00
parent a9e3ecc3ec
commit 016e71c06c
No known key found for this signature in database
2 changed files with 9 additions and 1 deletions

View File

@ -2,6 +2,7 @@
## 0.1.1 - Unreleased
- Honor `GITCRAWL_GITHUB_BASE_URL` and `GITHUB_BASE_URL` during `gitcrawl sync`, matching cached search and test-server workflows.
- Fix cached `search issues|prs` against portable stores by using portable-safe thread body and raw JSON columns.
- Keep read-only portable-store commands responsive when the backing Git remote is unavailable by making refresh best-effort and non-interactive with bounded SSH connection attempts.

View File

@ -805,6 +805,13 @@ func openAIBaseURL() string {
return strings.TrimSpace(os.Getenv("OPENAI_BASE_URL"))
}
func githubBaseURL() string {
if value := strings.TrimSpace(os.Getenv("GITCRAWL_GITHUB_BASE_URL")); value != "" {
return value
}
return strings.TrimSpace(os.Getenv("GITHUB_BASE_URL"))
}
func (a *App) runClusters(ctx context.Context, args []string) error {
return a.runClusterList(ctx, "clusters", args, false)
}
@ -1627,7 +1634,7 @@ func (a *App) syncRepository(ctx context.Context, owner, repo string, options sy
}
defer st.Close()
client := gh.New(gh.Options{Token: token.Value})
client := gh.New(gh.Options{Token: token.Value, BaseURL: githubBaseURL()})
service := syncer.New(client, st)
stats, err := service.Sync(ctx, syncer.Options{
Owner: owner,