From d7233f55f4b8e672dde61a89939b2d7869107bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Wed, 4 Oct 2023 22:29:16 -0400 Subject: [PATCH] Remove labels so nothing blows up, and tell people what we removed --- move_issue.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/move_issue.py b/move_issue.py index e21dcc7..651cfa8 100644 --- a/move_issue.py +++ b/move_issue.py @@ -34,6 +34,11 @@ def move_issue(source_owner, source_repo, issue_number, destination_owner, desti print(f"We have removed the milestone {milestone['title']} from this issue (milestones are specific to repositories).") # Note that pop has already thrown out the milestone from json_response + labels = json_response.pop('labels', {}) + if labels: + print("Labels are unique per project and rather than messing with creating ones with the same name we have removed the following labels:", ', '.join(l['name'] for l in labels)) + # Labels already removed with pop so we're good. + assignees = json_response.pop('assignees', {}) if assignees: # 'assignee' is deprecated; remove it.