Uh oh!
There was an error while loading. Please reload this page.
Authenticate CI git fetches of GitHub repos - #610
Merged
Conversation
GitHub throttles anonymous git HTTPS traffic per source IP, and Warp
runners share egress IPs across tenants. Starting 2026-09-02 ~12:30 UTC
that pool was throttled, so unauthenticated clones of public repos began
failing with 401s ("could not read Username for 'https://github.com'"):
Nix's eval-time builtins.fetchGit of Lake manifest dependencies broke
Nix CI, and Lake's own dependency clone broke cuda-compile, across
unrelated PRs.
Add an authenticate-github-fetches composite action that rewrites
github.com URLs via `url.insteadOf` to carry the job's ephemeral
GITHUB_TOKEN, moving every git-CLI fetch (Lake dependencies, eval-time
fetchGit, script clones) off the shared anonymous IP pool and onto
per-token limits. Wire it into:
- setup-rust-toolchain, alongside CARGO_NET_GIT_FETCH_WITH_CLI=true so
cargo's git dependencies fetch through the git CLI and pick up the
rewrite (cargo's built-in fetcher ignores insteadOf);
- both nix.yml jobs, which don't use that wrapper
(install-nix-action's github_access_token covers only `github:`
flake inputs, not git+https fetchGit);
- the bench compile jobs in bench-main and bench-pr, whose
`lake build Compile<env>` clones mathlib and friends without the
wrapper.
In bench-pr this puts the token in ~/.gitconfig where checked-out PR
code can read it, which persist-credentials: false previously kept off
disk. That is acceptable: the workflow's permissions block pins the
token to read-only on a public repo (the dispatch job's actions:write
never runs PR code), so the exposure matches an ordinary pull_request
run. Toolchain-only lean-action jobs (build: false) clone nothing and
are left alone, as is CodeQL, which manages its own fetches.samuelburnham
marked this pull request as ready for review
September 2, 2026 19:10
samuelburnham
enabled auto-merge
September 2, 2026 19:11
arthurpaulino
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub throttles anonymous git HTTPS traffic per source IP, and Warp runners share egress IPs across tenants. Starting 2026-09-02 ~12:30 UTC that pool was throttled, so unauthenticated clones of public repos began failing with 401s ("could not read Username for 'https://github.com'"): Nix's eval-time builtins.fetchGit of Lake manifest dependencies broke Nix CI, and Lake's own dependency clone broke cuda-compile, across unrelated PRs.
Add an authenticate-github-fetches composite action that rewrites github.com URLs via
url.insteadOfto carry the job's ephemeral GITHUB_TOKEN, moving every git-CLI fetch (Lake dependencies, eval-time fetchGit, script clones) off the shared anonymous IP pool and onto per-token limits. Wire it into:github:flake inputs, not git+https fetchGit);lake build Compile<env>clones mathlib and friends without the wrapper.In bench-pr this puts the token in ~/.gitconfig where checked-out PR code can read it, which persist-credentials: false previously kept off disk. That is acceptable: the workflow's permissions block pins the token to read-only on a public repo (the dispatch job's actions:write never runs PR code), so the exposure matches an ordinary pull_request run. Toolchain-only lean-action jobs (build: false) clone nothing and are left alone, as is CodeQL, which manages its own fetches.