Add token param

This commit is contained in:
2020-11-16 19:19:29 -05:00
parent 206284e599
commit 8d2ee0f91e
3 changed files with 16 additions and 3 deletions

View File

@ -4,10 +4,20 @@ from github import Github
logger = logging.getLogger()
logger.setLevel(logging.INFO)
github = Github("")
def lambda_handler(event, context):
# Secret Client
secretsmanager = boto3.client('secretsmanager')
# Get Secrets
token = secretsmanager.get_secret_value(SecretId=os.environ.get("GITHUB_TOKEN_SECRET")).get("SecretString")
# GitHub client
github = Github(token)
repo = github.get_repo(os.environ.get("REPOSITORY"))
if not "Records" in event: