guitarrapc / git-shallow-clone-orb

circleci orb to execute git shallow clone for faster checkout.
https://circleci.com/orbs/registry/orb/guitarrapc/git-shallow-clone
MIT License
21 stars 11 forks source link

Setting git config to use ssh instead of https breaks cloning from public repositories #31

Open Pi-George opened 2 years ago

Pi-George commented 2 years ago

This line in git clone shallow:

git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true

Is causing composer install to fail with:

[RuntimeException]                                                                                           
  Failed to clone https://github.com/Pi-George/laminas-file.git via https, ssh protocols, aborting.            

  - https://github.com/Pi-George/laminas-file.git                                                              
    Cloning into bare repository '/root/.cache/composer/vcs/https---github.com-Pi-George-laminas-file.git'...  
    git@github.com: Permission denied (publickey).                                                             
    fatal: Could not read from remote repository.                                                              

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

  - git@github.com:Pi-George/laminas-file.git                                                                  
    Cloning into bare repository '/root/.cache/composer/vcs/https---github.com-Pi-George-laminas-file.git'...  
    git@github.com: Permission denied (publickey).                                                             
    fatal: Could not read from remote repository.                                                              

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

Also worth noting, checkout is checking out a bitbucket repo, not a github repo.

guitarrapc commented 1 year ago

Need more info, including reproduce step would be appreciated.