Get the user's github profile information. Args: oauth_token (str): The Github OAuth2 token to use for authentication. Returns: requests.Response: The Github user response.
(oauth_token)
| 258 | |
| 259 | |
| 260 | def get_github_user_data(oauth_token): |
| 261 | """Get the user's github profile information. |
| 262 | |
| 263 | Args: |
| 264 | oauth_token (str): The Github OAuth2 token to use for authentication. |
| 265 | |
| 266 | Returns: |
| 267 | requests.Response: The Github user response. |
| 268 | |
| 269 | """ |
| 270 | headers = dict({'Authorization': f'token {oauth_token}'}, **JSON_HEADER) |
| 271 | response = requests.get('https://api.github.com/user', headers=headers) |
| 272 | if response.status_code == 200: |
| 273 | return response.json() |
| 274 | return {} |
| 275 | |
| 276 | |
| 277 | def get_github_primary_email(oauth_token): |
no outgoing calls