Prevent duplicate commit releases from webhooks

This commit is contained in:
rubenwardy 2021-02-04 19:54:26 +00:00
parent fb3b0be50e
commit 63204575eb
2 changed files with 6 additions and 0 deletions

@ -146,4 +146,7 @@ def webhook():
# Perform release # Perform release
# #
if package.releases.filter_by(commit_hash=ref).count() > 0:
return
return api_create_vcs_release(actual_token, package, title, ref, reason="Webhook") return api_create_vcs_release(actual_token, package, title, ref, reason="Webhook")

@ -63,6 +63,9 @@ def webhook_impl():
# Perform release # Perform release
# #
if package.releases.filter_by(commit_hash=ref).count() > 0:
return
return api_create_vcs_release(token, package, title, ref, reason="Webhook") return api_create_vcs_release(token, package, title, ref, reason="Webhook")