You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently enabled 2FA on my GitHub account and I can no longer execute .\build -t releasenotes. I get the following exception: Octokit.TwoFactorRequiredException: Must specify two-factor authentication OTP code.
The text was updated successfully, but these errors were encountered:
@Jericho yes, this makes sense. When using GitReleaseManager (and therefore Octokit) when also using 2FA, the recommendation is to use a Personal Access Token, rather than your actual password. When doing this, the 2FA will not be triggered, and it will work correctly.
Although the wording of the variables in Cake.Recipe suggest that it is a Password that is required, you can actually also pass a Token in as the parameter. This is what I do, and it works fine.
GitReleaseManager itself was recently updated to indicate that both a username/password, or a token can be used. Perhaps Cake.Recipe should be updated to reflect this as well.
I didn't realize that I could use my token in lieu of my password but I do know that there is an overload for the GitReleaseManagerCreate method where you can specify your token so I was going to edit the task to look like this (this is pseudo-code of the top of my head):
if (!string.IsNullOrEmpty(BuildParameters.GitHub.Token)) // Token would be a new parameter
{
GitReleaseManagerCreate(BuildParameters.GitHub.Token, BuildParameters.GitHub.UserName, blablabla);
}
else
{
GitReleaseManagerCreate(BuildParameters.GitHub.UserName, BuildParameters.GitHub.Password, blablabla);
}
I recently enabled 2FA on my GitHub account and I can no longer execute
.\build -t releasenotes
. I get the following exception:Octokit.TwoFactorRequiredException: Must specify two-factor authentication OTP code.
The text was updated successfully, but these errors were encountered: