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
Use valid git credentials when multiple are provided #1669
Conversation
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.
Great work! Just a small typo. I would have fixed it myself but don't have write access to your fork
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
2dffc91
to
0ec1718
Compare
Fixed the typo and conflicts, ready to merge! |
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.
Thanks 👍🏼
🎉 This PR is included in version 17.2.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
See #1668 for details about the issue. Here I will discuss about the fix implementation.
If the given URL works out of the box or if a single token is available in the environment, the behaviour remains unchanged.
However if there is multiple tokens available, it will perform a
git.verifyAuth
call for each of them, and return the first of them that is working.If none of them are working, it will return the URL as is.
This behaviour is tested in
integration.test.js
. It isn't tested inget-git-auth-url.test.js
because I need gitbox functionalities to test it.