Skip to content
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

Instructions for usage with 2FA #120

Open
pannous opened this issue May 26, 2021 · 0 comments
Open

Instructions for usage with 2FA #120

pannous opened this issue May 26, 2021 · 0 comments

Comments

@pannous
Copy link

pannous commented May 26, 2021

Currently with 2FA enabled one gets the error message

Forking is disabled on target repository, can't fork

~/ git pull-request
Username for 'https://github.com': 
Password for 'https://[email protected]': 
Forking is disabled on target repository, can't fork
Traceback (most recent call last):
  File "/opt/miniconda3/lib/python3.9/site-packages/git_pull_request/__init__.py", line 521, in fork_and_push_pull_request
    repo_forked = g_user.create_fork(repo_to_fork)
  File "/opt/miniconda3/lib/python3.9/site-packages/github/AuthenticatedUser.py", line 497, in create_fork
    headers, data = self._requester.requestJsonAndCheck(
  File "/opt/miniconda3/lib/python3.9/site-packages/github/Requester.py", line 353, in requestJsonAndCheck
    return self.__check(
  File "/opt/miniconda3/lib/python3.9/site-packages/github/Requester.py", line 378, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 401 {"message": "You must be logged in to do that.", "documentation_url": "https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication"}

Expected behaviour:

Catch and wrap the above exception to show how to use 2FA, e.g.

https://github.com/Mergifyio/git-pull-request/pull/102/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant