Skip to content

Commit

Permalink
Fix webhooks: they should return response.empty (no error) on github_…
Browse files Browse the repository at this point in the history
…post if it's not a valid PR
  • Loading branch information
root committed Aug 17, 2024
1 parent 4ca6d03 commit 6c431bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/webhooks/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
jinja2
sanic==21.12.2
GitPython
pyyaml
toml
websockets==10.0
babel
langcodes
language_data
2 changes: 2 additions & 0 deletions tools/webhooks/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ async def github_post(request: Request) -> HTTPResponse:

if valid_pr_comment:
return on_pr_comment(request, pr_infos)
else:
return response.empty()

return response.json({"error": f"Unknown event '{event}'"}, 422)

Expand Down

0 comments on commit 6c431bb

Please sign in to comment.