use repository.created instead of create.branch for master

This commit is contained in:
Lephenixnoir 2021-03-14 21:40:50 +01:00
parent ce478b06ef
commit 07ddf67043
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 5 additions and 7 deletions

12
app.py
View File

@ -90,19 +90,17 @@ def main():
msg = f"{url_user} a {action} la PR {url_pr} dans {url_repository}"
if event == "pull_request" and data["action"] == "assigned":
return "IGN"
if event == "create" and data["ref_type"] == "branch":
if data["ref"] not in ["master", "main", "trunk"]:
return "IGN"
if event == "repository" and data["action"] == "created":
url_user = make_url_user(data['sender'])
msg = f"{url_user} a créé un nouveau dépôt {url_repository}"
if event == "pull_request" and data["action"] == "assigned":
return "IGN"
if event == "fork":
return "IGN"
if event == "create" and data["ref_type"] == "tag":
if event == "create" and data["ref_type"] in ["tag", "branch"]:
return "IGN"
if not msg: