Swift dependencies in private Github repos

How do I add dependencies to a Swift Package, if those dependencies are in private repos?

This works in the Package file, but exposes my personal access token if I commit it:
.package(url:"https://personalaccesstoken@github.com/myname/myproject", from: .init(1, 0, 0)),

And I can't find a way to do it with SSH. Any help appreciated.

Via ~/.ssh/config probably the best way. GitHub has it in their official guide: Generating a new SSH key and adding it to the ssh-agent - GitHub Docs

1 Like

Short debrief:
My SSH public key was no longer accepted; generated a new one, made the adjustments under Xcode > Preferences > Accounts > Github, and all good.