From 605f95714130c960bce12eab98a4e023e8932249 Mon Sep 17 00:00:00 2001 From: Gregor Sturm Date: Wed, 16 Aug 2023 08:31:46 +0200 Subject: [PATCH] Fix logging for existing PRs --- scripts/src/scverse_template_scripts/cruft_prs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/src/scverse_template_scripts/cruft_prs.py b/scripts/src/scverse_template_scripts/cruft_prs.py index 08d1f4af..91f326c5 100644 --- a/scripts/src/scverse_template_scripts/cruft_prs.py +++ b/scripts/src/scverse_template_scripts/cruft_prs.py @@ -223,7 +223,7 @@ def make_pr(con: GitHubConnection, release: GHRelease, repo_url: str) -> None: origin = con.gh.get_repo(repo_url.removeprefix("https://github.com/")) repo = get_fork(con, origin) - if any(True for p in origin.get_pulls("open") if pr.matches_current_version(p)): + if old_pr := next((p for p in origin.get_pulls("open") if pr.matches_current_version(p)), None): log.info( f"PR for current version already exists: #{old_pr.number} with branch name `{old_pr.head.ref}`. Skipping." )