mirror of https://github.com/zulip/zulip.git
integrations: Simplify regex checks in GitHub Integration.
The regex check is replaced with a simpler "startswith" function.
This commit is contained in:
parent
dce4a3c98e
commit
caf6506811
|
@ -636,11 +636,11 @@ def get_tag_name_from_ref(ref_string: str) -> str:
|
|||
|
||||
|
||||
def is_commit_push_event(payload: WildValue) -> bool:
|
||||
return bool(re.match(r"^refs/heads/", payload["ref"].tame(check_string)))
|
||||
return payload["ref"].tame(check_string).startswith("refs/heads/")
|
||||
|
||||
|
||||
def is_merge_queue_push_event(payload: WildValue) -> bool:
|
||||
return bool(re.match(r"^refs/heads/gh-readonly-queue/", payload["ref"].tame(check_string)))
|
||||
return payload["ref"].tame(check_string).startswith("refs/heads/gh-readonly-queue/")
|
||||
|
||||
|
||||
def get_subject_based_on_type(payload: WildValue, event: str) -> str:
|
||||
|
|
Loading…
Reference in New Issue