From f33a673073a962af885d1facee8c02d533eb82d7 Mon Sep 17 00:00:00 2001 From: Junya Sasaki Date: Fri, 20 Dec 2024 13:12:40 +0900 Subject: [PATCH] fix: bugs that the latest tag is not parsed (#330) bug: fix bugs that the latest tag is not parsed Signed-off-by: Junya Sasaki --- .../create_prs_to_update_vcs_repositories.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/create-prs-to-update-vcs-repositories/create_prs_to_update_vcs_repositories.py b/create-prs-to-update-vcs-repositories/create_prs_to_update_vcs_repositories.py index c74d21d7..7dd64a58 100644 --- a/create-prs-to-update-vcs-repositories/create_prs_to_update_vcs_repositories.py +++ b/create-prs-to-update-vcs-repositories/create_prs_to_update_vcs_repositories.py @@ -204,13 +204,13 @@ def get_latest_tag(tags: list[str], current_version: str, target_release: str) - if target_release == 'major': if parsed_tag.major > current_ver.major: # Only consider tags with a higher major version - if latest_tag is None or parsed_tag < version.parse(latest_tag): + if latest_tag is None or parsed_tag > version.parse(latest_tag): latest_tag = tag elif target_release == 'minor': if parsed_tag.major == current_ver.major and parsed_tag.minor > current_ver.minor: # Only consider tags with the same major but higher minor version - if latest_tag is None or parsed_tag < version.parse(latest_tag): + if latest_tag is None or parsed_tag > version.parse(latest_tag): latest_tag = tag elif target_release == 'patch': @@ -218,13 +218,13 @@ def get_latest_tag(tags: list[str], current_version: str, target_release: str) - parsed_tag.minor == current_ver.minor and parsed_tag.micro > current_ver.micro): # Only consider tags with the same major and minor but higher patch version - if latest_tag is None or parsed_tag < version.parse(latest_tag): + if latest_tag is None or parsed_tag > version.parse(latest_tag): latest_tag = tag elif target_release == 'any': # Consider any version newer than the current version if parsed_tag > current_ver: - if latest_tag is None or parsed_tag < version.parse(latest_tag): + if latest_tag is None or parsed_tag > version.parse(latest_tag): latest_tag = tag return latest_tag