Skip to content

Commit

Permalink
Fixing list intersection error.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaxmonsky committed Aug 22, 2024
1 parent d96d575 commit bd42351
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/scripts/branch_pr_issue_closer.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,20 +229,20 @@ def _main_prog():
word_matches = keyword_pattern.finditer(pr_msg_lower, re.IGNORECASE)

#Go through all matches to pull out PR and issue numbers:
found_ids = []
found_ids = set()
for match in word_matches:
issue_dict = match.groupdict()
issue_num = int(issue_dict['id'].lstrip('0'))
found_ids.append(issue_num)
found_ids.add(issue_num)

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

close_pulls = found_ids and open_pulls
close_issues = found_ids and open_issues
close_pulls = list(found_ids.intersection(open_pulls))
close_issues = list(found_ids.intersection(open_issues))


#+++END REFERENCED PR LOOP+++
Expand Down

0 comments on commit bd42351

Please sign in to comment.