Allow filtering VCS webhooks based on branch name

Fixes #258
This commit is contained in:
rubenwardy
2024-06-22 12:13:49 +01:00
parent 09e06a159a
commit 7a94b9361f
3 changed files with 26 additions and 10 deletions

View File

@@ -162,7 +162,10 @@ def github_webhook():
ref = json["after"]
title = datetime.datetime.utcnow().strftime("%Y-%m-%d") + " " + ref[:5]
branch = json["ref"].replace("refs/heads/", "")
if branch not in [ "master", "main" ]:
if package.update_config and package.update_config.ref:
if branch != package.update_config.ref:
continue
elif branch not in ["master", "main"]:
continue
elif event == "create":