Commit be6b65f
Instantiation of all UsernamePasswordCredentials ensure non-null password.
It also supports null/empty password, but guards against passing null to
libgit2sharp.
This is to avoid runtime errors when using personal access tokens to authenticate
when fetching etc. from private github repos.
The standard way to authenticate:
new UsernamePasswordCredentials
{
Username = "<github-personal-access-token>", // GITVERSION_REMOTE_USERNAME
Password = string.Empty
};
GitVersion should support this authentication scheme necessary when having 2FA.
When using environment variables to propagate credentials password will end up
being null, because GITVERSION_REMOTE_PASSWORD is not present when passing empty
value.
This commit guards against libgit2sharp throwing LibGit2SharpException:
"UsernamePasswordCredentials contains a null Username or Password."1 parent 93df5e2 commit be6b65f
File tree
3 files changed
+4
-4
lines changed- src/GitVersionCore
- Core
- Extensions
- Model
3 files changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments