Skip to content

Commit f217715

Browse files
pedro-psbmdellweg
andcommitted
Deduplicate detected branches
Co-authored-by: Matthias Dellweg <2500@gmx.de>
1 parent fe1b004 commit f217715

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

templates/github/.ci/scripts/check_release.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def main(options: argparse.Namespace, template_config: dict[str, t.Any]) -> int:
9999

100100
# Warning: This will not work if branch names contain "/" but we don't really care here.
101101
heads = [h.split("/")[-1] for h in repo.git.branch("--remote").split("\n")]
102-
available_branches = [h for h in heads if re.fullmatch(RELEASE_BRANCH_REGEX, h)]
103-
available_branches.sort(key=lambda ver: Version(ver))
104-
available_branches.append(DEFAULT_BRANCH)
102+
available_branches = sorted(
103+
{h for h in heads if re.fullmatch(RELEASE_BRANCH_REGEX, h)}, key=lambda ver: Version(ver)
104+
) + [DEFAULT_BRANCH]
105105

106106
branches = options.branches
107107
if branches == "supported":

0 commit comments

Comments
 (0)