From 447646d6b8bc93cf27d80581e54f0185cb3f0f35 Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Mon, 20 Mar 2023 14:03:27 +0100 Subject: Independently remove labels before adding them --- labbot/addons/merge-label.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/labbot/addons/merge-label.py b/labbot/addons/merge-label.py index 2b6dffa..8be84b3 100644 --- a/labbot/addons/merge-label.py +++ b/labbot/addons/merge-label.py @@ -98,12 +98,15 @@ async def merge_label_hook(event, gl, *args, **kwargs): delete_labels.remove(label) remove_labels = ",".join(delete_labels) - log.debug(f"Applying {label} to {issue}") if remove_labels: log.debug(f"Removing `{remove_labels} from {issue}") + await gl.put(base_url, data={ + "remove_labels": remove_labels, + }) + + log.debug(f"Applying {label} to {issue}") await gl.put(base_url, data={ "add_labels": label, - "remove_labels": remove_labels, }) except KeyError: -- cgit v1.2.3