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

Deployment key mapping not working with Julia's built-in Package Manager (Pkg) #98

Open
dongqiu93 opened this issue Sep 17, 2021 · 5 comments

Comments

@dongqiu93
Copy link

The actions:

 - uses: webfactory/ssh-agent@v0.5.3
        with:
          ssh-private-key: |
            ${{ secrets.KEY1}} 
            ${{ secrets.KEY2}} 
      - name: Test Pkg Add Pkg1
        run: julia --project=docs/ -e 'using Pkg; Pkg.add(url="git@github.com:Org/Pkg1.jl.git");' 

Configuring deployment key(s)

Added deploy-key mapping: Use identity '/home/runner/.ssh/key-123456' for GitHub repository Org/Pkg1.jl
Added deploy-key mapping: Use identity '/home/runner/.ssh/key-234567' for GitHub repository Org/Pkg2.jl

When simply running `git clone git@github.com:Org/Pkg1.jl.git" it would work, but when running Julia Pkg.add, it would fail:

Run julia --project=docs/ -e 'using Pkg; Pkg.add(url="git@github.com:Org/Pkg1.jl.git");'
     Cloning git-repo `git@github.com:Org/Pkg1.jl.git`
ERROR: failed to clone from git@github.com:Org/Pkg1.jl.git, error: GitError(Code:ERROR, Class:Net, failed to resolve address for key-123456.github.com: Name or service not known)

It seems like the issue is with deploy-key mapping. Is there a way to stop this deploy-key mapping?

@mpdude
Copy link
Member

mpdude commented Nov 18, 2021

Please see this comment: #99 (comment) I added at #99. It might help you to find out if this is a problem with your key setup or the tool (julia?) you're using.

Note that you don't have to put the repo name into the key comment if you don't want the key to be used for a particular repo only.

If you have one key and it works in multiple (or all) repositories, just omit the key comment. That way, no mapping will be set up.

@mpdude
Copy link
Member

mpdude commented Nov 18, 2021

This is probably about the Julia Language and its package manager: https://docs.julialang.org/en/v1/stdlib/Pkg/

@mpdude mpdude changed the title Multiple private repo not able to be added Deployment key mapping not working with Julia's built-in Package Manager (Pkg) Nov 18, 2021
@ykomarov94
Copy link

@dongqiu93 Have you found a solution for this problem? Or maybe some workaround?

@dmoored4
Copy link

Bumping to see if anybody else has a good workaround?

@DilumAluthge
Copy link
Contributor

DilumAluthge commented Dec 1, 2022

Could you try setting the JULIA_PKG_USE_CLI_GIT environment variable to true?

So, in your example, you would try something like this:

- uses: webfactory/ssh-agent@v0.5.3
  with:
    ssh-private-key: |
      ${{ secrets.KEY1}} 
      ${{ secrets.KEY2}} 
- name: Test Pkg Add Pkg1
  run: julia --project=docs/ -e 'using Pkg; Pkg.add(url="git@github.com:Org/Pkg1.jl.git");' 
  env:
    JULIA_PKG_USE_CLI_GIT: 'true'

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