Switching default keychain
See original GitHub issueDescribe the bug
Ultimately, I’m trying to use match/gym to build apps through a self-hosted runner.
I’ve tried many combinations of the following:
bundle exec fastlane run create_keychain
bundle exec fastlane run unlock_keychain
However, the result of security default-keychain
is always /Library/Keychain/System
. I can only change the system default with sudo
Has anyone been able to work though a similar issue? I’ve found a lot of similar or outdated issues, but they all point to things like “use setup_ci” or unlock the keychain, but I think the crux of the problem here is the inability to change the default keychain.
Alternatively, I’m able to see valid certs with
security find-identity -v -p codesigning mykeychain
but unable to see them with
security find-identity -v -p codesigning
Is there a way for me to get xcodebuild
to use the specific keychain?
To Reproduce See above
Expected behavior
$ security default-keychain mykeychain
$ security default-keychain
/path/to/mykeychain
Runner Version and Platform
OSX - tar xzf ./actions-runner-linux-x64-2.165.2.tar.gz
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (2 by maintainers)
I’m experiencing this issue as well @TingluoHuang. What is interesting here is that this works the first time I install the the runner but stops working after the machine is rebooted (reinstalling the runner makes it work again).
When the problem starts occurring,
security default-keychain
returns only the system keychain if it’s being ran by the runner. If I ssh to the machine under the same user,security default-keychain
returns the correct keychain. The only workaround I found so far is to reinstall the runner.I read elsewhere on SO having only the latest should be enough, though it in any case its emission last month seems to be related to this issue. Devilishly hard to debug indeed.