Giter VIP home page Giter VIP logo

Comments (8)

mpdude avatar mpdude commented on July 25, 2024 2

I copied the public key using xclip -sel clip < ~/.ssh/github_actions.pub and pasted the content in the deploy_key config of GitHub under the title GITHUB_ACTIONS_DEPLOY_KEYS

I've understood this as that you added the public part of the SSH key as a deployment key in the private repo – haven't you?

A deployment key tells GitHub that the owner of the private key part (your GHA workflow in this case) is entitled to clone the repository, also if it is private. You need to make sure that cloning happens with a SSH URL, which should look like [email protected]:webfactory/ssh-agent.git.

from ssh-agent.

ryanzidago avatar ryanzidago commented on July 25, 2024 2

@mpdude

I had the deploy key set up on the repository where the GitHubActions were triggered, not the private dependency itself. Now GHA can finally clone/fetch the private dependency.

Many thanks!

from ssh-agent.

mpdude avatar mpdude commented on July 25, 2024 1

Could you do me a favor and re-read the README file? Is there anything missing or worded unprecisely that could have saved you the hassle?

from ssh-agent.

mpdude avatar mpdude commented on July 25, 2024

Strange – at first, this all looks right.

What seems strange to me is that the ssh-agent tries to read from .ssh/id_rsa, although we never put the key there. It's read from STDIN.

In my test runs, the action output looks like this:

Run webfactory/[email protected]
  with:
    ssh-private-key: ***
Adding GitHub.com keys to /home/runner/.ssh/known_hosts
Starting ssh-agent
Adding private key to agent
Identity added: (stdin) ((stdin))
Keys added:
4096 SHA256:/XOu...long.id.here...R1kaI (stdin) (RSA)

Do you see this output as well before your dependency-fetching step starts?

from ssh-agent.

ryanzidago avatar ryanzidago commented on July 25, 2024

I have something almost similar:

Run webfactory/[email protected]
  with:
    ssh-private-key: ***
Adding GitHub.com keys to /home/runner/.ssh/known_hosts
Starting ssh-agent
Adding private key to agent
Identity added: (stdin) (ryan@name_of_my_computer)
Keys added:
256 SHA256:/XOu...long.id.here...R1kaI ryan@name_of_my_computer (ED25519)

Don't know if it matters, but as you can see, sometime stdin is replaced by ryan@name_of_my_computer and the line after keys added starts with 256 instead of 4096. Aslo RSA is replaced with ED25519.

from ssh-agent.

mpdude avatar mpdude commented on July 25, 2024

No, that's not an issue. It's a comment field embedded in the SSH key, and it's the type and length of the key. That's all fine IMO.

Could you add run: git clone {ssh-url-for-your-private-repo} right after the webfactory/ssh-agent action step? That way, we could check if a simple, plain git clone works for the repo and the key.

from ssh-agent.

ryanzidago avatar ryanzidago commented on July 25, 2024

I get that:

Cloning into 'my_private_dependency'...
Warning: Permanently added the RSA host key for IP address 'some_IP' to the list of known hosts.
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.

So I cannot simply clone the repo. From what I understood, I shouldn't have to configure anything on the private repo side or?

from ssh-agent.

kai490952010 avatar kai490952010 commented on July 25, 2024

@mpdude I'm going through something identical here. Have set public key as Deploy Keys in the private repo. And, set private key as Secret in the repo running github actions. Only difference between the issue and my case, is that I'm trying to install the private git repo via pipenv. Any idea what could be causing this error ?

FAIL
ERROR:pip.subprocessor:Command errored out with exit status 128:
 command: git clone -q ssh://github.com/kai490952010/<repo>.git /tmp/pipenv-5x2u39s9-src/csci-utils
     cwd: None
Complete output (6 lines):
Warning: Permanently added the RSA host key for IP address '140.82.114.3' to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

from ssh-agent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.