-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(git): insteadOf environment variables for authentication #11077
Conversation
BTW: git v2.31.0 is from march 2021. so we should add a hint for self-hosted users.
renovate/docs/usage/self-hosting.md Line 1 in 36d37b3
|
I tried adding a git version detection previously and had to give up. Surely shouldn't be too hard. Maybe we could try with v26 and have an option to skip detection if it fails? |
Yes, that could be an option. The worst happening is that git ignores the environment variables. Meaning that just the authentication for |
I know, it's on my to-do list. Will check what's going wrong on your branch. |
Because the failure is therefore graceful, I'm ok with merging this without adding logic to check/warn about git, because that's not for go modules only. However if Go Modules auth was working before with a certain version of git but then stop working in a newer version of Renovate, I think that's probably best to go into v26 as a breaking change so that it's less likely to be missed. |
🎉 This PR is included in version 28.3.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Changes:
This PR uses the newly in git 2.31 introduced environment variables for authentication for go module updates (e.g. sum files).
The current change only replaces the existing functionality and provides a generic function to get authentication environment variables for git via
getGitAuthenticatedEnvironmentVariables(gitUrl, token, environmentVariables)
.Requires git cli >=2.31 to use
GIT_CONFIG_
variables to provide the credentials as environment variables to thego get
process, which then invokesgit
underneath.Happy about any feedback :)
Context:
Fixes #11060
Part of enabling authenticated go module updates #7361
Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via: