ssh-agent
ssh-agent copied to clipboard
Comment for (public) key does not match GitHub URL pattern
I get this comment at the the end of the action:
Comment for (public) key 'ssh-ed25519 <redacted>' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.
Comment for (public) key '' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.
Is this a bug? What does it mean?
I got a similar error:
Adding private key(s) to agent
Identity added: (stdin) (github.com:ProjectAussie/pawsit-sdk.git)
Key(s) added:
4096 SHA256:<redacted> github.com:ProjectAussie/pawsit-sdk.git (RSA)
Configuring deployment key(s)
Added deploy-key mapping: Use identity '/home/runner/.ssh/key-<redacted>' for GitHub repository ProjectAussie/pawsit-sdk
Comment for (public) key '' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.
I thought I had added a comment that supported the github regex for my public key when I created the key with: ssh-keygen -b 4096 -t rsa -f key -C "github.com:ProjectAussie/pawsit-sdk.git"
It has to do with deployment key mappings, which are described in https://github.com/webfactory/ssh-agent#using-multiple-keys and https://github.com/webfactory/ssh-agent#support-for-github-deploy-keys.
Comment for (public) key 'ssh-ed25519 <redacted>' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.
This means that key had a key comment, but it does not look like a GitHub repository URL. So, no special configuration is created to make sure this particular key is being used when cloning this particular repo.
It's an informational message intended to help when setting up deployment key mappings.
Comment for (public) key '' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.
That must be a glitch when we go through key comments. Maybe a trailing blank line that was not stripped correctly? Happy to accept patches :-).
If that answers your question, please close the issue.
Thanks!
@Smarker
Added deploy-key mapping: Use identity '/home/runner/.ssh/key-<redacted>' for GitHub repository ProjectAussie/pawsit-sdk
That worked for you, the key should be used for the repo you gave in the key comment.
Comment for (public) key '' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.
That's the glitch, ignore it for now.
I got the same issue: When I'm creating a ssh key via: ssh-keygen -t ecdsa -b 256 -m PEM -C '[email protected]:GreenG0blin/repo.git' I got this message:
Comment for (public) key 'ecdsa-sha2-nistp256 <pubkey> (stdin)' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.
When I create the ssk key via ssh-keygen -t ecdsa -b 256 -C '[email protected]:GreenG0blin/repo.git' without pem, it works. But unfortunately I need the key in PEM format. It seems like a bug since in the readme is explicity written, that the key has to be im PEM format: https://github.com/webfactory/ssh-agent#ssh-private-key-format Very confusing ...
There is also an issue with the regex pattern used key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i); - this only works with the official github.com and does not work with the enterprise version hosted at a different domain (e.g. github.mycompany.co.uk.
@vitalytarasov there's an extra issue regarding other URLs than github.com, it's #128
@GreenG0blin you might be seeing #93 or a variant thereof.
Not all key formats and/or keys created with various flags/settings actually contain the key comments, but I haven’t fully understood the issue myself either.
Just wanted to add info from my struggles :) It seems very important (especially on Windows) that the URL in the SSH key comment matches the URL that you want to fetch from. I was using Yarn (NPM for that matter), and the URL started with git+ssh://[email protected]:<....> or just simple ssh://[email protected]<....> in which case ssh-agent was unable to find the correct key. Using simply [email protected]:<....> in Yarn's package.json seemed to get me through the pain.