Include baseURL and allow enterprise support

This commit is contained in:
Layla 2020-11-16 19:52:23 -05:00
parent 2c07f1c369
commit 1bf9a3ac89
No known key found for this signature in database
GPG Key ID: A494D9357BA1BE31

View File

@ -5,8 +5,6 @@ logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
# Secret Client
@ -16,7 +14,7 @@ def lambda_handler(event, context):
token = secretsmanager.get_secret_value(SecretId=os.environ.get("GITHUB_TOKEN_SECRET")).get("SecretString")
# GitHub client
github = Github(token)
github = Github(base_url=f"https://{os.environ.get('GITHUB_HOSTNAME','github.com')}/api/v3", login_or_token=token)
repo = github.get_repo(os.environ.get("REPOSITORY"))