From a39d73afddad6c73ce474da6b21cb926c5c009b3 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Mon, 23 Dec 2024 20:42:29 +0000 Subject: [PATCH] Validate single branch for tag Handles case where tagged commit exists on multiple branches - such as when we branch for a new release and then immediately tag an RC. Signed-off-by: Brad Davidson --- scripts/validate-release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/validate-release b/scripts/validate-release index 2d49673b81..9a4826db82 100755 --- a/scripts/validate-release +++ b/scripts/validate-release @@ -32,7 +32,7 @@ function get-module-version() { } function check_release_branch() { - TAG_BRANCH=$(git branch --all -q --contains $GIT_TAG | grep origin | grep -vE 'dependabot|updatecli|origin$|HEAD' | sed -e 's/^[[:space:]]*//') + TAG_BRANCH=$(git branch --all -q --contains $GIT_TAG | grep origin | grep -vE 'dependabot|updatecli|origin$|HEAD' | sed -e 's/^[[:space:]]*//' | tail -1) if [ "$TAG_BRANCH" == "remotes/origin/master" ]; then K8S_VERSION_GO_MOD=$(get-module-version k8s.io/kubernetes | cut -d. -f1-2) if [ "v$MAJOR.$MINOR" == "$K8S_VERSION_GO_MOD" ]; then