From 1bf9a3ac89f74b5bc77c5b4abe5848734ba413fe Mon Sep 17 00:00:00 2001 From: Joseph Manley Date: Mon, 16 Nov 2020 19:52:23 -0500 Subject: [PATCH] Include baseURL and allow enterprise support --- create_issue/lambda_function.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/create_issue/lambda_function.py b/create_issue/lambda_function.py index 5d6f69e..3a0227c 100644 --- a/create_issue/lambda_function.py +++ b/create_issue/lambda_function.py @@ -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"))