diff --git a/scripts/get_latest_release.sh b/scripts/get_latest_release.sh index 872f07c64e..aa3335b515 100755 --- a/scripts/get_latest_release.sh +++ b/scripts/get_latest_release.sh @@ -12,7 +12,7 @@ LATEST_REL=$(curl --silent "https://api.github.com/repos/$REPO_TO_USE/releases/l # Check if this is a release branch THIS_BRANCH=$(git rev-parse --abbrev-ref HEAD) -if [[ "$THIS_BRANCH" =~ $BRANCH_TO_USE ]]; +if [[ $(echo "$THIS_BRANCH" | grep -c ^"$BRANCH_TO_USE") == 1 ]]; then VERSION_REL=${THIS_BRANCH//$BRANCH_TO_USE/v} REL_TO_USE=$(curl --silent "https://api.github.com/repos/$REPO_TO_USE/releases" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed -n "/$VERSION_REL/p" | sort -rV | head -n 1)