From 016e71c06c11a9cdac2b014eeb15bc8100d381ab Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 30 Apr 2026 04:48:32 +0100 Subject: [PATCH] fix(cli): honor GitHub API base URL during sync --- CHANGELOG.md | 1 + internal/cli/app.go | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79368a6..a626946 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/internal/cli/app.go b/internal/cli/app.go index e1d365f..3ad6795 100644 --- a/internal/cli/app.go +++ b/internal/cli/app.go @@ -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,