Xcodebuild wants to use confidential information stored in “github.com” in your keychain during CI build

Hi,

I am running xcodebuild through Fastlane in a macOS CI environment and I constantly get this popup:

xcodebuild wants to use your confidential information stored in "github.com" in your keychain.

This blocks the CI because the dialog requires user interaction.

What is the correct way to completely disable Keychain access for GitHub credentials in a non-interactive CI environment while still using HTTPS authentication?

Has anyone solved this reliably for Fastlane/Xcode CI builds?

I already set the -scmProvider to system via xcodebuild

Thanks!

Don’t store GitHub credentials on CI machines, including in the macOS Keychain.

By default, Xcode and the macOS command-line tools may use git-credential-osxkeychain, which can cause Git to/Xcode to try to read credentials from the Keychain. On CI machines, I would remove that credential helper completely so the build never attempts to access Keychain-stored GitHub credentials.

Also, if possible, reset or recreate the macOS Keychain for each build. That way, the CI job cannot accidentally depend on credentials or other state left over from a previous run.

In short:

  1. Do not store github.com credentials in the CI machine’s Keychain.

  2. Remove git-credential-osxkeychain from the CI Git configuration.

  3. Prefer ephemeral CI machines or reset the Keychain between builds.

Happy coding!

You have to unlock keychain first. You can do it with either unlock_keychain action or following command sudo -u $LOCAL_USER_NAME security unlock-keychain -p "$CURRENT_LOCAL_USER_PASS". After that I recommend creation of temporary keychain via create_keychain action (remember to delete it at the end of job with delete_keychain ).

Fixed the problem. The solution was to change packageAuthorizationProvider from keychain to netrc in xcodebuild.