Skip to content

Commit bd42351

Browse files
committed
Fixing list intersection error.
1 parent d96d575 commit bd42351

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/scripts/branch_pr_issue_closer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,20 +229,20 @@ def _main_prog():
229229
word_matches = keyword_pattern.finditer(pr_msg_lower, re.IGNORECASE)
230230

231231
#Go through all matches to pull out PR and issue numbers:
232-
found_ids = []
232+
found_ids = set()
233233
for match in word_matches:
234234
issue_dict = match.groupdict()
235235
issue_num = int(issue_dict['id'].lstrip('0'))
236-
found_ids.append(issue_num)
236+
found_ids.add(issue_num)
237237

238238
#End script if no keyword/id pairs were found:
239239
if not found_ids:
240240
endmsg = f"Pull request #{pr_num} was merged without using any of the keywords. "
241241
endmsg += "Thus there are no issues to close."
242242
end_script(endmsg)
243243

244-
close_pulls = found_ids and open_pulls
245-
close_issues = found_ids and open_issues
244+
close_pulls = list(found_ids.intersection(open_pulls))
245+
close_issues = list(found_ids.intersection(open_issues))
246246

247247

248248
#+++END REFERENCED PR LOOP+++

0 commit comments

Comments
 (0)