MCPcopy
hub / github.com/gitcoinco/web / github_connect

Function github_connect

app/git/utils.py:47–67  ·  view source on GitHub ↗

Authenticate the GH wrapper with Github. Args: token (str): The Github token to authenticate with. Defaults to: None.

(token=None)

Source from the content-addressed store, hash-verified

45
46
47def github_connect(token=None):
48 """Authenticate the GH wrapper with Github.
49
50 Args:
51 token (str): The Github token to authenticate with.
52 Defaults to: None.
53
54 """
55 github_client = None
56 if not token:
57 token = settings.GITHUB_API_TOKEN
58
59 try:
60 github_client = Github(
61 login_or_token=token,
62 client_id=settings.GITHUB_CLIENT_ID,
63 client_secret=settings.GITHUB_CLIENT_SECRET,
64 )
65 except BadCredentialsException as e:
66 logger.exception(e)
67 return github_client
68
69
70def get_gh_issue_details(org, repo, issue_num, token=None):

Callers 5

get_gh_issue_detailsFunction · 0.85
get_gh_issue_stateFunction · 0.85
search_usersFunction · 0.85
get_gh_notificationsFunction · 0.85
get_current_ratelimitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected