From 67c67947c4f20a7c2fa35cd9c66147b91171d1cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 29 Oct 2025 14:43:28 +1100 Subject: [PATCH] get previos version should handle future version --- .github/scripts/get_previous_version.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/scripts/get_previous_version.sh b/.github/scripts/get_previous_version.sh index 7bdcd7b..3e8da62 100755 --- a/.github/scripts/get_previous_version.sh +++ b/.github/scripts/get_previous_version.sh @@ -148,6 +148,13 @@ if [ "$#" -eq 0 ]; then else # One argument: find previous version VERSION="$1" + LATEST_VERSION="${filtered_versions[0]}" + + # if version is larger than the latest version, return latest version + if bash "$VALIDATE_SEMVER" "$VERSION" ">${LATEST_VERSION}" >/dev/null 2>&1; then + echo "$LATEST_VERSION" + exit 0 + fi # Find the version in the list for i in "${!filtered_versions[@]}"; do