Github Actions: xcodebuild fails due to server fingerprint
Finally I figured it out. It seems like its a known issue in Xcode 11 (https://developer.apple.com/documentation/xcode_release_notes/xcode_11_release_notes).
Thanks to Dosium in this post (https://discuss.bitrise.io/t/xcode-11-resolving-packages-fails-with-ssh-fingerprint/10388), I was able to get it work.
The solution is to run the following command before running xcodebuild:for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts
For CircleCI
:
Adding onto Yakuhzi's answer, here's what the step looks like in Circle Ci's yaml file:
- run: name: Enable SSH command: | for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts
Open the project on the machine that does the building.Go to the Workspace logs.Double click on the red log entry that says the package failed to validate.Now you get a window that asks you to trust the host.Trust it, and you're good to go.
Edit: I was wrong. While it does trust the host and you can open & run the project on the CI machine, the CI process still fails...