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

Function get_github_emails

app/git/utils.py:336–357  ·  view source on GitHub ↗

Get all email addresses associated with the github profile. Args: oauth_token (str): The Github OAuth2 token to use for authentication. Returns: list of str: All of the user's associated email from git.

(oauth_token)

Source from the content-addressed store, hash-verified

334
335
336def get_github_emails(oauth_token):
337 """Get all email addresses associated with the github profile.
338
339 Args:
340 oauth_token (str): The Github OAuth2 token to use for authentication.
341
342 Returns:
343 list of str: All of the user's associated email from git.
344
345 """
346 emails = []
347 headers = dict({'Authorization': f'token {oauth_token}'}, **JSON_HEADER)
348 response = requests.get('https://api.github.com/user/emails', headers=headers)
349
350 if response.status_code == 200:
351 email_data = response.json()
352 for email in email_data:
353 email_address = email.get('email')
354 if email_address and 'noreply.github.com' not in email_address:
355 emails.append(email_address)
356
357 return emails
358
359
360def get_emails_master(username):

Callers 2

get_emails_masterFunction · 0.85

Calls

no outgoing calls

Tested by 1