Skip to content

Commit 61ea970

Browse files
committed
Add the 'label work required' label to invalid issues and remove it from valid ones
1 parent 1d2a513 commit 61ea970

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

normalize_repos/validate_issues.py

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
log.reset_handler()
1010

1111
TRIAGE_LABEL = "🚦 status: awaiting triage"
12+
LABEL_WORK_REQUIRED_LABEL = "🏷 status: label work required"
1213

1314

1415
def dump_invalid_issues(invalid_issues):
@@ -55,8 +56,12 @@ def are_issue_labels_valid(issue, required_groups):
5556
if not label_names.intersection(required_labels):
5657
missing_groups.append(group.name)
5758
if missing_groups:
59+
issue.add_to_labels(LABEL_WORK_REQUIRED_LABEL)
5860
logger.log(logging.INFO, f"Issue '{issue.title}' has missing labels.")
5961
return False, f"Missing labels from groups: {', '.join(missing_groups)}"
62+
else:
63+
if LABEL_WORK_REQUIRED_LABEL in label_names:
64+
issue.remove_from_labels(LABEL_WORK_REQUIRED_LABEL)
6065

6166
logger.log(logging.INFO, f"Issue '{issue.title}' is OK.")
6267
return True, None

0 commit comments

Comments
 (0)