integrations: Simplify regex checks in GitHub Integration.

The regex check is replaced with a simpler "startswith" function.
This commit is contained in:
Satyam Bansal 2023-05-27 11:24:52 +05:30 committed by Tim Abbott
parent dce4a3c98e
commit caf6506811
1 changed files with 2 additions and 2 deletions

View File

@ -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: