Fix webhooks: they should return response.empty (no error) on github_post if it's not a valid PR
This commit is contained in:
parent
4c04ef911c
commit
f6cb50d374
2 changed files with 11 additions and 0 deletions
9
webhooks/requirements.txt
Normal file
9
webhooks/requirements.txt
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
jinja2
|
||||||
|
sanic==21.12.2
|
||||||
|
GitPython
|
||||||
|
pyyaml
|
||||||
|
toml
|
||||||
|
websockets==10.0
|
||||||
|
babel
|
||||||
|
langcodes
|
||||||
|
language_data
|
|
@ -73,6 +73,8 @@ async def github_post(request: Request) -> HTTPResponse:
|
||||||
|
|
||||||
if valid_pr_comment:
|
if valid_pr_comment:
|
||||||
return on_pr_comment(request, pr_infos)
|
return on_pr_comment(request, pr_infos)
|
||||||
|
else:
|
||||||
|
return response.empty()
|
||||||
|
|
||||||
return response.json({"error": f"Unknown event '{event}'"}, 422)
|
return response.json({"error": f"Unknown event '{event}'"}, 422)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue