My CircleCI project checks-out from a GitHub repo (i.e. that’s what the build is linked to) and also checks out another repo from GitHub. I have configured a “machine key” for the other repo via SSH Permissions at the project level.
However, I receive the following error when
git cloneing the secondary repo:
Please make sure you have the correct access rights and the repository exists.
When I check which SSH key is being used to authenticate w/ GitHub, I see it’s the “deploy key” (which doesn’t have access to the secondary repo):
ssh -T firstname.lastname@example.org Hi owner/repo! You've successfully authenticated, but GitHub does not provide shell access.
To fix this issue, I remove the “deploy key” during build startup:
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub ssh-add -d ~/.ssh/id_rsa.pub
Then I get the correct response:
ssh -T email@example.com Hi machine-account! You've successfully authenticated, but GitHub does not provide shell access.
git clone works too
This a nasty hack though! Is it possible to fix this?