Skip to content
This repository was archived by the owner on Nov 28, 2024. It is now read-only.
This repository was archived by the owner on Nov 28, 2024. It is now read-only.

Instructions for usage with 2FA #120

@pannous

Description

@pannous

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://xxxx@github.com': 
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions