From 8f0bedf9c9e8136f2c7a3d382269fda54f4b3736 Mon Sep 17 00:00:00 2001 From: Elisabeth Kulzer Date: Mon, 2 Mar 2020 22:01:45 +0100 Subject: [PATCH] Fix triggering the release logic on a branch with release in its name. (#13915) Co-authored-by: mattermod --- scripts/get_latest_release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)