I am having problems on a CI of a private repository of mine, the following error arises during the buildkpg phase of the CI:
caused by: GitError(Code:EUSER, Class:Callback, Aborting, user cancelled credential request.)
The reason is due to the fact that in the building phase of the environment, I do have the https link to the private package (https://github.com//.jl), but it seems like in the process, the CI does not recognize that it is run from my package.
So, you have a package, say, Foo.jl and you also have Foo.jl in the [deps] section of the Project.toml? Or do you have another package that refers to your private package Foo.jl?
Generally, what you could do in situations where there is a private repository inside the Manifest.toml is to install it before running buildpkg. For example:
getting access to the repository inside the GitHub Action is possible. You can use a GitHub Action like webfactory/ssh-agent@v0.5.4 to set a secrets.DEPLOY_KEY from your private repository to give GitHub Actions access from one private repository to another.
EDIT: To avoid confusion. What I mean by DEPLOY_KEY is that you add a key to the deploy keys of your private repository and put this key as a secret in the repository in which you currently have problems. Then, set that secret via webfactory/ssh-agent before running the Pkg.add.
Run webfactory/ssh-agent@v0.5.4
Adding GitHub.com keys to /home/runner/.ssh/known_hosts
Starting ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-lN2HPXrnFuVC/agent.1665
SSH_AGENT_PID=1666
Adding private key(s) to agent
Identity added: (stdin) (git@github.com:davide-f/<repo>.jl.git)
Key(s) added:
4096 SHA256:yAtLh9RzQGzTIGFpDat7iegtJKxD1zBF1I+33laqnE8 git@github.com:davide-f/<repo>.jl.git (RSA)
Configuring deployment key(s)
Added deploy-key mapping: Use identity '/home/runner/.ssh/key-...' for GitHub repository davide-f/<repo>.jl
Comment for (public) key '' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.
Yes, see the message before, basically the error is the last line of the first block:
Comment for (public) key '' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.
It seems like the keys are not recognized somehow, though it seems to me that they should be fine.
This error suggests that the SSH is not successful and as a consequence, the error I was experiencing during the building of the environment is not solved.
The subsequent error is as follows:
ERROR: failed to clone from https://github.com/davide-f/<repo>.jl, error: GitError(Code:ERROR, Class:Net, failed to resolve address for key-cd9edd77eda3f8efb9b9586183a4d3d26afe042eb1e7e8b23e8b41238d3ef161.github.com: Name or service not known)
I’m having the same issue and I can’t figure out how to get the webfactory ssh-agent to work for multiple keys to different private repos. Would you mind sharing what your CI.yml looks like now with the fix you mentioned above?