def create()

in cloudformation/custom_resources/githubhelper/custom_resource.py [0:0]


def create(event, context):
    # DO NOT LOG
    github_token = secrets.get_secret_value(SecretId=event['ResourceProperties']['TokenSecretName'])['SecretString']
    g = Github(github_token)
    user = g.get_user()
    url = str(event['ResourceProperties']["sourceRepo"]).replace("https://github.com/", "").split("/")
    repo = g.get_repo(f'{url[0]}/{url[1]}')
    logger.info("Forking the blog source repo...")
    my_fork = user.create_fork(repo)
    amplify_clone_url = f"https://github.com/{user.login}/{my_fork.name}"
    helper.Data["cloneUrl"] = amplify_clone_url