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

Comment for key does not match Github URL pattern #76

Closed
smofe opened this issue Apr 27, 2021 · 3 comments
Closed

Comment for key does not match Github URL pattern #76

smofe opened this issue Apr 27, 2021 · 3 comments

Comments

@smofe
Copy link

smofe commented Apr 27, 2021

I want to access two different private repositories that contain packages for an App. I have created one ssh key for each of the two repos, added the private key to the secrets of the App-Repository and the public keys as deploy keys in the private package repositories.

My workflow looks as follow:

- uses: webfactory/ssh-agent@v0.5.2
      with:
          ssh-private-key: |
              ${{ secrets.SSH_PRIVATE_KEY_APISERVICE }}
              ${{ secrets.SSH_PRIVATE_KEY_WIDGETS }}
    
    - run: git clone git@github.com:[organization-name]/[repository-name1]
    
    - run: git clone git@github.com:[organization-name]/[repository-name2]

The public keys look like the following:

ssh-rsa AA[...]Gj 
git@github.com:[organization-name]/[repository-name1]

Running the workflow produces the following log:

Adding GitHub.com keys to /home/runner/.ssh/known_hosts
Starting ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-To1irqpM9o5v/agent.1571
SSH_AGENT_PID=1572
Adding private key(s) to agent
Identity added: (stdin) ((stdin))
Identity added: (stdin) ((stdin))
Key(s) added:
2048 SHA256:lF6[...]JsM (stdin) (RSA)
2048 SHA256:Wqc[...]FMbA8 (stdin) (RSA)
Configuring deployment key(s)
Comment for key 'ssh-rsa AA[...]Gj (stdin)' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.
Comment for key 'ssh-rsa AA[...]Gb (stdin)' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.
Comment for key '' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.

Afterwards, the first git clone command works as excpected, the second one fails with the error:

ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Error: Process completed with exit code 128.

It's always the second clone command that fails, even if I swap the order in which the repositories are cloned.

I'm stuck and don't know if I am doing something wrong, or if this is some Bug with this Action. Any help is very appreciated!

@mpdude
Copy link
Member

mpdude commented Apr 28, 2021

Key(s) added:
2048 SHA256:lF6[...]JsM (stdin) (RSA)
2048 SHA256:Wqc[...]FMbA8 (stdin) (RSA)

I think that we should see the key comments in the place where (stdin) is shown. Are you sure that the key comment is set correctly also in the private key?

With which command did you create the keys?

@mpdude
Copy link
Member

mpdude commented May 3, 2021

Closing for now; feel free to reopen/comment when you verified the key comment is correct.

@mpdude mpdude closed this as completed May 3, 2021
@maxyousif15
Copy link

Experiencing the same issue here. The command used to create the SSH key is ssh-keygen -t rsa -b 4096 -C "git@github.com:some_owner/some_repo.git" -m PEM. Any ideas why this causes a failure? I can see the comments when I cat the public key, so not sure why it is not recognised by the ssh-agent as valid

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

3 participants