From ffa2b438ae0d25163ebd9ea7d28be53fdf57b85b Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Wed, 4 May 2022 15:50:36 +0200 Subject: do not relabel draft merge requests --- labbot/addons/merge-label.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/labbot/addons/merge-label.py b/labbot/addons/merge-label.py index 506573e..27e179b 100644 --- a/labbot/addons/merge-label.py +++ b/labbot/addons/merge-label.py @@ -31,14 +31,19 @@ act_labels = [ ] async def merge_label_hook(event, gl, *args, **kwargs): + title = event.object_attributes["title"] + description = event.object_attributes["description"] state = event.object_attributes["state"] related_issues = [] - match = re.search(title_regex, event.object_attributes["title"]) + if title.lower().startswith("draft"): + return + + match = re.search(title_regex, title) if match: related_issues.append(match.group(1)) - for line in event.object_attributes["description"].split("\\n"): + for line in description.split("\\n"): line = line.lower() line_list = line.split(" ") -- cgit v1.2.3