Git config is ignored in gitlab-ci by pnpm (OK with npm)
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 :
- git config --global url."https://github.com/".insteadOf "ssh://[email protected]/"
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
having the same issue here using Vercel, whereas it works with npm.
any resolutions to this??
having the same issue
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 :)