Skip to content

org-ci: give git the private-repo token for git+https and uv git fetches - #36

Merged
andrewthomaslee merged 2 commits into
mainfrom
ci-git-credentials
Nov 14, 2026
Merged

andrewthomaslee merged 2 commits into
mainfrom
ci-git-credentials

Conversation

@andrewthomaslee

Copy link
Copy Markdown
Member

Summary

 flake-check job
   app-token (private-repos)
+  git config url."https://x-access-token:$TOKEN@github.com/".insteadOf "https://github.com/"
+    only when the App or NIX_GITHUB_TOKEN is set
   install-nix (access-tokens = same token)

Nix's git fetcher ignores access-tokens, so git+https:// inputs (needed for exact <major>.<minor>.<commits> versions) and uv2nix git dependencies (an org Python library in uv.lock) on a private repo fail in CI today. This step gives git the token CI already mints. Documented in documentation/docs/ci.md.

Evidence

Local, Nix 2.34.9, fresh fetcher cache, blank git config, no SSH agent, private external-systems/secrets:

Credentials builtins.fetchGit (uv2nix's call) git+https flake input
none fail fail
access-tokens only fail fail
git insteadOf with the token ok —

nix run .#flake-check → rc=0.

Merge Danger

Door: two-way

Blast Radius: private-repo CI

Repos with neither the App nor the PAT skip the step (unchanged). Repos with one get git auth for github.com in the flake-check job only. Independent of #35; no merge order.

🤖 Generated with Claude Code

Nix's git fetcher ignores access-tokens, so git+https flake inputs and
uv2nix git dependencies on a private org repo fail in CI even with the
App token or PAT. When either is configured, point git at the same
token; public-only repos are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andrewthomaslee
andrewthomaslee enabled auto-merge (squash) November 14, 2026 18:12
@andrewthomaslee
andrewthomaslee merged commit 549d95c into main Nov 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant