From 292e888f2a571aee3cfc474172e23fb559f8f2eb Mon Sep 17 00:00:00 2001 From: Carly Gundy <47304080+cgundy@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:53:46 +0100 Subject: [PATCH] move onto one line --- reusable_workflows/check_cla/check_cla_pr.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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