aboutsummaryrefslogtreecommitdiff
path: root/labbot
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2022-05-04 15:50:36 +0200
committerJan200101 <sentrycraft123@gmail.com>2022-05-04 15:50:36 +0200
commitffa2b438ae0d25163ebd9ea7d28be53fdf57b85b (patch)
tree2e25d4d8737adf20018bc0ee03389a5ac889ca40 /labbot
parent7bb73cd925a0dc9547699dd555b9f990d8f3ae39 (diff)
downloadlab-bot-ffa2b438ae0d25163ebd9ea7d28be53fdf57b85b.tar.gz
lab-bot-ffa2b438ae0d25163ebd9ea7d28be53fdf57b85b.zip
do not relabel draft merge requests
Diffstat (limited to 'labbot')
-rw-r--r--labbot/addons/merge-label.py9
1 files 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(" ")