diff --git a/reusable_workflows/check_cla/check_cla_pr.py b/reusable_workflows/check_cla/check_cla_pr.py index 88526e1..cf9d4e1 100644 --- a/reusable_workflows/check_cla/check_cla_pr.py +++ b/reusable_workflows/check_cla/check_cla_pr.py @@ -22,10 +22,7 @@ def __init__(self, gh: github3.login) -> None: def check_if_comment_already_exists( search_comment: str, comments: github3.structs.GitHubIterator ) -> bool: - for comment in comments: - if search_comment == comment.body: - return True - return False + return any(search_comment == comment.body for comment in comments) def leave_failed_comment_on_issue(self, issue: GHIssue) -> None: # check if bot has already left a message to avoid spam