Skip to content

Commit d3e903d

Browse files
committed
ci-automation/image-changes: Simplify getting a major version
1 parent 402a3aa commit d3e903d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ci-automation/image_changes.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,11 @@ function get_channel_a_and_version_a() {
491491
local -n gcaava_version_a_ref="${gcaava_version_a_varname}"
492492
local major_a major_b channel version
493493

494-
major_a=$(echo "${new_channel_prev_version}" | cut -d . -f 1)
495-
major_b=$(echo "${new_channel_new_version}" | cut -d . -f 1)
494+
major_a=${new_channel_prev_version%%.*}
495+
major_b=${new_channel_new_version%%.*}
496496
# 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
497-
if [ "${major_a}" != "${major_b}" ]; then
498-
case "${new_channel}" in
497+
if [[ ${major_a} != "${major_b}" ]]; then
498+
case ${new_channel} in
499499
lts)
500500
channel=stable
501501
;;

0 commit comments

Comments
 (0)