fix: authenticate token-based dependency pulls via netrc#78
Merged
Conversation
Embedding the token in git insteadOf URLs makes Xcode's Swift Package Manager hang forever during dependency resolution on macOS runners: SPM asks the keychain for HTTPS credentials (even for public packages) and the headless keychain prompt can never be answered, see actions/runner-images#6233 A ~/.netrc file is the documented way to authenticate both git HTTPS clones (pub get) and xcodebuild/SPM on CI without touching the keychain. The remaining insteadOf rewrites only map ssh-style URLs to HTTPS and contain no credentials.
xcodebuild's own SCM consults the macOS keychain for HTTPS credentials even for public packages and hangs headless runners. Forcing the SwiftPM builtin SCM (system git) makes package resolution honor gitconfig and ~/.netrc like every other git operation. This is the defaults equivalent of `xcodebuild -scmProvider system`, required because `flutter build ipa` invokes xcodebuild internally and cannot forward the flag.
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 free
to 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.
Summary
build_ioson famedly/app#7173 hangs forever during Xcode SPM dependency resolution whenever the token-based auth path is active — regardless of whether theinsteadOfrewrites are global (fix: use git config --add for token insteadOf rewrites #76) or scoped to the famedly org (fix: scope token insteadOf rewrites to the famedly org #77).~/.netrc. Both git (HTTPS clones forpub get) and xcodebuild/SPM read it, and no keychain records are created.insteadOfrewrites only map ssh-style URLs to HTTPS and contain no credentials — the same class of rewrite the proven SSH path uses.Verification
Verified locally with an isolated
$HOME(own.netrc, own gitconfig, no credential helper, SSH disabled):https://github.com/famedly/famedly-design.gitresolves via netrc, without any token in git URLs ✓git@github.com:famedly/famedly-design.gitis rewritten to HTTPS and resolves via netrc ✓~/.gitconfigcontains no credentials ✓Made with Cursor