diff --git a/README.md b/README.md index 92616a6..b48595a 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ make deploy ``` 1. Get your REST api ID ```bash -awsdocker "aws apigateway get-rest-apis | jq -r '.[][][\"id\"]' +awsdocker "aws apigateway get-rest-apis | jq -r '.[][][\"id\"]'" ``` 1. Query the lambda via API Gateway. ```bash diff --git a/client.py b/client.py index fc11aba..a0a1811 100755 --- a/client.py +++ b/client.py @@ -43,7 +43,7 @@ def main(): ) response = getattr(requests, method.lower())(url, auth=auth) - print("Request sent. Hope it worked :shrug:") + print(f"{response.content}") def get_args_config() -> Dict: diff --git a/lambda_function.py b/lambda_function.py index bc94648..0791019 100755 --- a/lambda_function.py +++ b/lambda_function.py @@ -5,6 +5,7 @@ from typing import Dict import sys +import json from argparse import ArgumentParser import requests @@ -14,11 +15,15 @@ def lambda_handler(event, context): AWS Lambda handler """ print(event) - check_for_commit( + status = check_for_commit( account=event["queryStringParameters"]["account"], repository=event["queryStringParameters"]["repository"], commitish=event["queryStringParameters"]["commit"], ) + response_code = 200 + body = json.dumps({'status': status}) + response = {'statusCode': response_code, 'body': body} + return response def main():