Intial setup

This commit is contained in:
2020-08-13 01:06:25 -04:00
parent 546fccc0a0
commit 206284e599
4 changed files with 99 additions and 0 deletions

View File

@ -0,0 +1,19 @@
import logging, boto3, os
from github import Github
logger = logging.getLogger()
logger.setLevel(logging.INFO)
github = Github("")
def lambda_handler(event, context):
repo = github.get_repo(os.environ.get("REPOSITORY"))
if not "Records" in event:
raise Exception("Missing key Records in event!")
for record in event["Records"]:
if "Sns" in record:
sns_event = record["Sns"]
repo.create_issue(sns_event["Subject"], body=sns_event["Message"] + "\nThis was generated by " + os.environ.get("GENERATED_OWNER", "AWS"))

View File

@ -0,0 +1,2 @@
boto3
PyGithub