Adding support for otp codes automatically #24
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's Changed?
GithubCredentials
to support the OTP code--otp-code
to supply your 2FA code on program run/~https://github.com/pquerna/otp
to handle TOTP generationconfig.yml
and the new CLI argumentTesting
I recommend creating a throwaway Github account in order to test this easier (otherwise you will need to redo your 2FA setup on your account to grab the TOTP Seed value). An image of where to click during the 2FA setup process is included below that lets you grab the raw TOTP seed value.

Update your
config.yml
with the newgithub_totp_seed
field.Run:
echo "test.com" | ./git-hound
Comment out the new field in
config.yml
Run:
echo "test.com" | ./git-hound --otp-code <code>
Comment out the new field in
config.yml
Run:
echo "test.com | ./git-hound
-- Ensure you are prompted for 2FA CodeWhy?
I was getting annoyed while using this and having to manually enter my 2FA code every time. This allows the user to have some flexibility with automatically generating a TOTP code or letting them supply it in the CLI. Worst case, they are just prompted for it.
Feel free to adjust things as needed.