Skip to content

Commit 725b340

Browse files
committed
allow use of no label on assignee search
1 parent b1b3fba commit 725b340

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/update_release_pr.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,13 @@ def get_prs_assignees(pull_request_items: list[dict], label: str = "", state: st
117117
state (str): State of PR, e.g. open, closed, all
118118
119119
Returns:
120-
list: A list of strs, where each string represents an assignee.
120+
list: A list of strs, where each string is an assignee name. List is not distinct, so can contain
121+
duplicate names.
121122
Returns an empty list if none are found.
122123
"""
123124
assignee_list = []
124125
for pr in pull_request_items:
125-
if pr["state"] == state and [item for item in pr["labels"] if item["name"] == label]:
126+
if pr["state"] == state and [item for item in pr["labels"] if not label or item["name"] == label]:
126127
[assignee_list.append(assignee["login"]) for assignee in pr["assignees"] if assignee["login"] != "jjw24" ]
127128

128129
print(f"Found {len(assignee_list)} assignees with {label if label else 'no'} label and state as {state}")

0 commit comments

Comments
 (0)