Skip to content

fix: fetch github.com dependencies with the job token on self-hosted runners - #23

Merged
ltetzlaff merged 1 commit into
mainfrom
fix/self-hosted-authenticated-fetch
Oct 28, 2026
Merged

ltetzlaff merged 1 commit into
mainfrom
fix/self-hosted-authenticated-fetch

Conversation

@ltetzlaff

@ltetzlaff ltetzlaff commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Self-hosted runners behind a shared egress IP can hit GitHub's per-IP throttling of anonymous clones while several jobs resolve cold. SwiftPM's https://github.com/… clones then all fail at once:

error: 'swift-atomics': Failed to clone repository https://github.com/apple/swift-atomics.git:
    fatal: could not read Username for 'https://github.com': terminal prompts disabled

On self-hosted runners only, the Resolve dependencies and Build steps (the build's recovery path re-resolves) now rewrite https://github.com/ to authenticated URLs using the job's github.token, so clones count against the token's allowance. The rewrite is set through step-scoped GIT_CONFIG_* env, so nothing is written to a git config file, and the token is masked like any github.token. Hosted runners get GIT_CONFIG_COUNT=0, so nothing changes for them.

@ltetzlaff
ltetzlaff merged commit 0991912 into main Oct 28, 2026
10 of 11 checks passed
@ltetzlaff
ltetzlaff deleted the fix/self-hosted-authenticated-fetch branch October 28, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant