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

Not working on Windows: "Not treating it as a GitHub deploy key" #130

Closed
sfullerbeckman opened this issue Sep 19, 2022 · 10 comments
Closed

Comments

@sfullerbeckman
Copy link

sfullerbeckman commented Sep 19, 2022

See comment below for updated bug information: #130 (comment)

Old...
I am adding the below private key, which is stored in the repo's secrets. The corresponding public key is found as a deploy key in another repo within the same private Github organization. Below is the yaml where I am trying to install my private key.

- name: Install SSH Key
        uses: webfactory/ssh-agent@v0.5.4
        with:
          ssh-private-key: ${{ secrets.ACCESS_KEY }}

When this is run, I get this.

Key(s) added
Configuring deployment key(s)
...
Added deploy-key mapping: Use identity...
Comment for (public) key '' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.

What doest that last line mean? Does this mean that something went wrong? It looks like it thinks the public key is empty based on the empty quotes?

@sfullerbeckman
Copy link
Author

@mpdude ?

@sebastiankugler
Copy link
Member

@sfullerbeckman
Copy link
Author

sfullerbeckman commented Sep 19, 2022

The error message refers to https://github.com/webfactory/ssh-agent#support-for-github-deploy-keys

@sebastiankugler , I've read that section two or three times and still don't understand what specifically is going wrong. The public part of the ssh key I created I put in the Deploy Keys section of the repo I am trying to clone. I used this command ssh-keygen -t ed25519 -C "[link to private repo I am trying to clone]" And then I put the private key in the secrets of the repo that the workflow is in. What am I doing wrong?

This is a StackOverflow link that explains the entirety of the problem. Maybe it's helpful to you: https://stackoverflow.com/questions/73775185/not-treating-it-as-a-github-deploy-key

@csaba-kovacs
Copy link

I'm having the same issue:

Comment for (public) key '' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.

Where:
Cloning into '/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20220922-1213-1xo8s4a'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

@doctenahasib
Copy link

I'm having the same issue:

Comment for (public) key '' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.

Where: Cloning into '/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/d20220922-1213-1xo8s4a'... ERROR: Repository not found. fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

I also get the same issue. I use docker and forward the ssh with --ssh default but it works on my local machine (using macOS)

@sfullerbeckman
Copy link
Author

sfullerbeckman commented Oct 12, 2022

@sebastiankugler, @mpdude, @MalteWunsch After discussing in this issue (actions/checkout#928 (comment)), I finally got it to work when I ran on ubuntu-latest instaed of windows-latest. This shows that there is an issue with this package on Windows. Can this be investigated, please?

@sfullerbeckman sfullerbeckman changed the title "Not treating it as a GitHub deploy key" Doesn't work on Windows: "Not treating it as a GitHub deploy key" Oct 12, 2022
@sfullerbeckman sfullerbeckman changed the title Doesn't work on Windows: "Not treating it as a GitHub deploy key" "Not treating it as a GitHub deploy key" Oct 12, 2022
@sfullerbeckman sfullerbeckman changed the title "Not treating it as a GitHub deploy key" Not working on Windows: "Not treating it as a GitHub deploy key" Oct 12, 2022
@mpdude
Copy link
Member

mpdude commented Oct 19, 2022

@sfullerbeckman could you please check if #137 solves the issue for you?

@mpdude
Copy link
Member

mpdude commented Oct 19, 2022

@sfullerbeckman

#137 hopefully resolved an issue with Windows-based runners not finding the right git binary.
#139 removed a meaningless/confusing/wrong log message

There is a remaining issue that when using actions/checkout with submodules: true|recursive, that action might revert the configuration set up by this one here. I have opened actions/checkout#973 to coordinate. In the meantime, check if doing the submodule initialization manually at a later step and putting webfactory/ssh-agent after actions/checkout (#92) helps for the time being.

@sfullerbeckman
Copy link
Author

sfullerbeckman commented Oct 19, 2022

@mpdude , doing the submodule initialization manually at a later step and putting webfactory/ssh-agent after actions/checkout does work for the time being. Thank you.

@sfullerbeckman
Copy link
Author

sfullerbeckman commented Apr 9, 2023

Closing this issue since this #130 (comment) provided an answer for what I need at the time being. Other problems are captured in other issues.

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

5 participants