ssh-agent
ssh-agent copied to clipboard
Multiple keys not working
I have a React project that has two private repositories as dependencies. I created two SSH keys, added private keys as secrets and added public keys as deploy keys in the dependency repository.
This is the code from the pipeline
- name: SSH
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.SSH_PRIVATE_KEY1 }}
${{ secrets.SSH_PRIVATE_KEY2 }}
For some reason, the connection works only for the first key. I have tried putting SSH_PRIVATE_KEY2 first, and it worked for the repository that has SSH_PRIVATE_KEY2 public key counterpart, then I put SSH_PRIVATE_KEY1 first, and it worked for the repository that has SSH_PRIVATE_KEY1 public key counterpart.
Is someone else having the same issue?
Yep, also having no luck. Even after following steps here to align git config and ssh config. I can clearly see by executing:
RUN --mount=type=ssh GIT_SSH_COMMAND="ssh -v" pip install git+ssh://[email protected]/owner/repo-b
that it is still trying to use the public deploy key from repo-a to authenticate to github for repository b. Really frustrating - been stuck on this for literally days and I think I'm as far as I can go.
I seem to be experiencing the same problem. I think it may be related to new GH keys as discussed in v0.8.0
Single keys work, multiple not. I'm considering to try @shaunco 's fork
The PR of which was rejected: https://github.com/webfactory/ssh-agent/pull/38
More detail on his solution: https://github.com/webfactory/ssh-agent/issues/30