-
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/auth): Support hostrules with username and password when authenticating git commands #24081
Conversation
…henticating git commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise LGTM
🎉 This PR is included in version 36.79.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Okay, after adding a whole lot of We were previously relying on the host types So, essentially I have the following host rules: [
{
hostType: 'github',
matchHost: 'github.com',
token: 'github-token',
resolvedHost: 'github.com'
},
{
hostType: 'git-refs',
matchHost: 'mygitlab.com',
password: 'mygitlab-pwd',
username: 'renovate-bot',
resolvedHost: 'mygitlab.com'
},
{
hostType: 'git-tags',
matchHost: 'mygitlab.com',
password: 'mygitlab-pwd',
username: 'renovate-bot',
resolvedHost: 'mygitlab.com'
},
{
matchHost: 'mygitlab.com',
token: 'mygitlab-pwd',
hostType: 'gitlab',
resolvedHost: 'mygitlab.com'
}
] The host rule created from Filtering for {
GIT_CONFIG_KEY_0: 'url.https://ssh:[email protected]/.insteadOf',
GIT_CONFIG_VALUE_0: 'ssh://[email protected]/',
GIT_CONFIG_KEY_1: 'url.https://git:[email protected]/.insteadOf',
GIT_CONFIG_VALUE_1: '[email protected]:',
GIT_CONFIG_KEY_2: 'url.https://[email protected]/.insteadOf',
GIT_CONFIG_VALUE_2: 'https://github.com/',
GIT_CONFIG_COUNT: '6',
GIT_CONFIG_KEY_3: 'url.https://renovate-bot:[email protected]/.insteadOf',
GIT_CONFIG_VALUE_3: 'ssh://[email protected]/',
GIT_CONFIG_KEY_4: 'url.https://renovate-bot:[email protected]/.insteadOf',
GIT_CONFIG_VALUE_4: '[email protected]:',
GIT_CONFIG_KEY_5: 'url.https://renovate-bot:[email protected]/.insteadOf',
GIT_CONFIG_VALUE_5: 'https://mygitlab.com/'
} And manually running I also confirm that running What do you think? We might still be missing some scenarios for |
Btw, I did find |
please open a new discussion |
you can of cause use the existing discussion, but not the PR. this PR is wrong place to discuss things. |
Changes
This pull request introduces the ability to authenticate git commands using a combination of username and password through host rules in addition to the currently supported token format.
Context
Fixes #24077
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: