Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/utilities/issue_assign.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

It checks if a comment on an issue or PR includes the trigger
phrase (as defined) and a mentioned user.
If it does, it assigns the issue/PR to the mentioned user.
If it does, it assigns the issue to the mentioned user.
"""

import json
Expand All @@ -19,10 +19,11 @@
issue_number = context_dict["event"]["issue"]["number"]
issue = repo.get_issue(number=issue_number)
comment_body = context_dict["event"]["comment"]["body"]
pr = context_dict["event"]["issue"].get("pull_request")

# Assign tagged used to the issue if the comment includes the trigger phrase
body = comment_body.lower()
if "@aeon-actions-bot" in body and "assign" in body:
if "@aeon-actions-bot" in body and "assign" in body and not pr:
mentioned_users = re.findall(r"@[a-zA-Z0-9_-]+", comment_body)
mentioned_users = [user[1:] for user in mentioned_users]
mentioned_users.remove("aeon-actions-bot")
Expand Down