pnpm icon indicating copy to clipboard operation
pnpm copied to clipboard

Git config is ignored in gitlab-ci by pnpm (OK with npm)

Open hakaba opened this issue 3 years ago • 3 comments

Hi,

I have a strange behaviours in a gitlab-ci job (sorry, not public). I have to use https instead of ssh for a dependency from github.

So, I add in my CI :

The package.json contains this line

"devDependencies": {
    "webpack-iconfont-plugin-nodejs": "hakaba/webpack-iconfont-plugin-nodejs#1.0.0"
  },

If I install the project with npm, I have no issue as npm will use git that will use the global config and then https But if I try to use pnpm, the git config is ignored and I have a timeout as ssh port is not open.

Why git do not use his global config with pnpm ?

(I do not know how to reproduce this behavious with minimal setting).

Thanks

hakaba avatar Jan 18 '22 11:01 hakaba

having the same issue here using Vercel, whereas it works with npm.

rodsfreitas avatar Jan 04 '23 21:01 rodsfreitas

any resolutions to this??

nv08 avatar Sep 25 '23 13:09 nv08

having the same issue

gitim avatar Jun 25 '24 06:06 gitim

Unfortunately I have just hit this as well, anyone found a workaround?


Edit: finally found a solution, for npm this override worked:

git config --global url."https://oauth2:${CI_GROUP_TOKEN}@${CI_SERVER_HOST}/".insteadOf "git@${CI_SERVER_HOST}:"

But for pnpm this is what is needed:

git config --global url."https://oauth2:${CI_GROUP_TOKEN}@${CI_SERVER_HOST}/".insteadOf "ssh://git@${CI_SERVER_HOST}/"

Hope this saves someone the hour I just spent on this :)

mgcrea avatar Jul 17 '24 08:07 mgcrea