Pulling private SPM repos in Xcode

First off - the SPM support in Xcode is really, really great. Kudos to all involved.

I have a project that pulls in a private repository via SSH from an organization that I belong to on GitHub. I followed these instructions (with Deploy Keys) to get it working in our development flow: IBM Developer. However, with the new Xcode integration, I keep bumping into Authentication failed because credentials were missing error. I have tried the following steps:

  1. Reauthenticating locally with GitHub
  2. Adding a new deploy key
  3. Adding my id_rsa key as a deploy key (GitHub does not allow this, but I tried)
  4. Regenerating the project
  5. Deleting the .ssh folder in the project folder
  6. Manually selecting my deploy key public cert in the accounts picker in settings

All of the above produce the same error. swift build works fine as I believe it looks at .ssh automatically. I believe there may be something wrong with Xcode where it is not picking up that folder.

Does anyone know how I could solve this? Apologies if this is not an appropriate place for this post, and thanks in advance.

4 Likes

You should file bug reports on Xcode with Apple at https://feedbackassistant.apple.com.

1 Like

Right, please file this issue via https://feedbackassistant.apple.com. The forums are a great place to discuss OSS-related SwiftPM features/bugs. The line can get blurry sometimes so always feel free to ask!

1 Like

Awesome - appreciate the feedback. I have filed there as well and remove this post. Thank you!

1 Like

In case anyone else stumbles upon this problem, I solved it via: ssh-keyscan github.com >> ~/.ssh/known_hosts

12 Likes

We prefer to leave posts like this up so that other people with similar problems can easily find them. Thanks for trying it out and reporting the bug!

7 Likes