Skip to content

Commit

Permalink
fix: added integration response to allow 200 status codes
Browse files Browse the repository at this point in the history
Signed-off-by: Trey <[email protected]>
  • Loading branch information
TreyWW committed May 31, 2024
1 parent ff79668 commit 614477d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
20 changes: 15 additions & 5 deletions .github/management_bot/pulumi/__main__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions .github/management_bot/pulumi/src/lambda_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -98,4 +98,4 @@ def lambda_handler(event, context):
"""
)

return {"statusCode": 200, "body": json.dumps("Success")}
return {"statusCode": 200, "body": {}}

0 comments on commit 614477d

Please sign in to comment.