From d3e903db3378f3b5f782f8cdfc61c55eef2dd0b8 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Mon, 27 Nov 2023 11:26:43 +0100 Subject: [PATCH] ci-automation/image-changes: Simplify getting a major version --- ci-automation/image_changes.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-automation/image_changes.sh b/ci-automation/image_changes.sh index 372c2d0819..7159f5e89f 100644 --- a/ci-automation/image_changes.sh +++ b/ci-automation/image_changes.sh @@ -491,11 +491,11 @@ function get_channel_a_and_version_a() { local -n gcaava_version_a_ref="${gcaava_version_a_varname}" local major_a major_b channel version - major_a=$(echo "${new_channel_prev_version}" | cut -d . -f 1) - major_b=$(echo "${new_channel_new_version}" | cut -d . -f 1) + major_a=${new_channel_prev_version%%.*} + major_b=${new_channel_new_version%%.*} # When the major version for the new channel is different, a transition has happened and we can find the previous release in the old channel - if [ "${major_a}" != "${major_b}" ]; then - case "${new_channel}" in + if [[ ${major_a} != "${major_b}" ]]; then + case ${new_channel} in lts) channel=stable ;;