Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple SSH keys not working on GitHub Enterprise #117

Closed
lcmgh opened this issue Jun 7, 2022 · 2 comments
Closed

Multiple SSH keys not working on GitHub Enterprise #117

lcmgh opened this issue Jun 7, 2022 · 2 comments

Comments

@lcmgh
Copy link

lcmgh commented Jun 7, 2022

Hi!

I followed the docs to setup multiple ssh keys by generating them with comment parameter -C and adding the git URL from my GitHub Enterprise repo.

https://private-github.myenterprise/org/repo.git

I ensured correct keys were set as secret and deploy key but it seems correct keys are not mapped.

    - uses: webfactory/[email protected]
      with:
          ssh-private-key:  |
            ${{ secrets.DEPENDENCY_ACCESS_2 }}
            ${{ secrets.DEPENDENCY_ACCESS_2 }}

ERROR: Permission to abc denied to deploy key
fatal: Could not read from remote repository.

Might it be because only github.com URLs are supported?

child_process.execSync(`git config --global --replace-all url."git@key-${sha256}.github.com:${ownerAndRepo}".insteadOf "https://github.com/${ownerAndRepo}"`);

Thanks

@mpdude
Copy link
Member

mpdude commented Sep 1, 2022

Yes. The problem is that we need to recognize the different repo names, set up fake hostnames for them, then map those back to the right ones while specifying the key in the SSH config and finally make git rewrite differnt variants of the original URL to the replacement hosts... 🥴.

If anyone comes up with a good suggestion how to make this work for repo URLs in general (i. e. not limited to the [email protected]/org/repo pattern), I'd be happy to discuss that!

@mpdude
Copy link
Member

mpdude commented Sep 1, 2022

This is the same as #112, let's discuss it over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants