From bff7334143d820faa7d0e858113d621f3af086e1 Mon Sep 17 00:00:00 2001 From: Manan Gupta Date: Wed, 23 Feb 2022 11:44:37 +0530 Subject: [PATCH] feat: use the latest major release patch to run upgrade tests for release branches Signed-off-by: Manan Gupta --- tools/get_latest_release.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/get_latest_release.sh b/tools/get_latest_release.sh index c8a54a12a0..206d94a423 100755 --- a/tools/get_latest_release.sh +++ b/tools/get_latest_release.sh @@ -25,7 +25,8 @@ target_release="" base_release_branch=$(echo "$1" | grep -E 'release-[0-9]*.0$') if [ "$base_release_branch" != "" ]; then major_release=$(echo "$base_release_branch" | sed 's/release-*//' | sed 's/\.0//') - target_release="release-$((major_release-1)).0" + target_major_release=$((major_release-1)) + target_release=$(git show-ref --tags | grep -E 'refs/tags/v[0-9]*.[0-9]*.[0-9]*$' | sed 's/[a-z0-9]* refs\/tags\/v//' | awk -v FS=. -v RELEASE=$target_major_release '{if ($1 == RELEASE) print; }' | sort -nr | head -n1) else target_release="release-$(git show-ref | grep -E 'refs/remotes/origin/release-[0-9]*\.0$' | sed 's/[a-z0-9]* refs\/remotes\/origin\/release-//' | sort -nr | head -n1)" fi