diff --git a/hubsrht/blueprints/webhooks.py b/hubsrht/blueprints/webhooks.py index 1ac4e63..e547a2f 100644 --- a/hubsrht/blueprints/webhooks.py +++ b/hubsrht/blueprints/webhooks.py @@ -63,6 +63,8 @@ def git_repo(repo_id): return "I don't recognize that repository.", 404 if event == "repo:post-update": + if not payload["refs"][0]["new"]: + return "Thanks!" commit_sha = payload["refs"][0]["new"]["id"][:7] commit_url = repo.url() + f"/commit/{commit_sha}" commit_message = payload["refs"][0]["new"]["message"].split("\n")[0]