diff --git a/.github/management_bot/pulumi/__main__.py b/.github/management_bot/pulumi/__main__.py index 76bb3c40..d913ff57 100644 --- a/.github/management_bot/pulumi/__main__.py +++ b/.github/management_bot/pulumi/__main__.py @@ -1,10 +1,6 @@ -"""An AWS Python Pulumi program""" - from __future__ import annotations import json -from contextlib import closing - import pulumi from pulumi_aws import apigateway, iam @@ -80,7 +76,21 @@ ) api_gw_200_resp = apigateway.MethodResponse( - "200_resp", rest_api=rest_api.id, resource_id=rest_api.root_resource_id, http_method="POST", status_code="200" + "200_resp", + rest_api=rest_api.id, + resource_id=rest_api.root_resource_id, + http_method="POST", + status_code="200", + response_models={"application/json": "Empty"}, +) + +api_gw_integration_resp = apigateway.IntegrationResponse( + "integ_resp", + rest_api=rest_api.id, + resource_id=rest_api.root_resource_id, + http_method="POST", + status_code="200", + response_templates={"application/json": json.dumps({})}, ) api_gw_lambda = lambda_.Permission( diff --git a/.github/management_bot/pulumi/src/lambda_handler.py b/.github/management_bot/pulumi/src/lambda_handler.py index 43270aeb..c1b9bcb8 100644 --- a/.github/management_bot/pulumi/src/lambda_handler.py +++ b/.github/management_bot/pulumi/src/lambda_handler.py @@ -34,7 +34,7 @@ def send_error(issue, *, body, sender, msg_len, required, example_cmd): ) -def lambda_handler(event, context): +def lambda_handler(event: dict, _): auth = Auth.AppAuth(APP_ID, PRIVATE_KEY).get_installation_auth(event.get("installation", {}).get("id")) g = Github(auth=auth) @@ -98,4 +98,4 @@ def lambda_handler(event, context): """ ) - return {"statusCode": 200, "body": json.dumps("Success")} + return {"statusCode": 200, "body": {}}