Authenticate the GH wrapper with Github. Args: token (str): The Github token to authenticate with. Defaults to: None.
(token=None)
| 45 | |
| 46 | |
| 47 | def 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 | |
| 70 | def get_gh_issue_details(org, repo, issue_num, token=None): |
no outgoing calls
no test coverage detected