From be3e4cc3916d3714a21267c544ede98755cd5be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenkai=20Yin=28=E5=B0=B9=E6=96=87=E5=BC=80=29?= Date: Mon, 21 Feb 2022 16:33:48 +0800 Subject: [PATCH] Bug fixing, only check whether the tag is the latest version when tag isn't empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug fixing, only check whether the tag is the latest version when tag isn't empty Signed-off-by: Wenkai Yin(尹文开) --- hack/docker-push.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/hack/docker-push.sh b/hack/docker-push.sh index 9b6c4ed18..8ad3df113 100755 --- a/hack/docker-push.sh +++ b/hack/docker-push.sh @@ -56,27 +56,23 @@ elif [[ "$triggeredBy" == "tags" ]]; then TAG=$(echo $GITHUB_REF | cut -d / -f 3) fi +TAG_LATEST=false if [[ ! -z "$TAG" ]]; then echo "We're building tag $TAG" + VERSION="$TAG" # Explicitly checkout tags when building from a git tag. # This is not needed when building from main git fetch --tags # Calculate the latest release if there's a tag. highest_release - VERSION="$TAG" + if [[ "$TAG" == "$HIGHEST" ]]; then + TAG_LATEST=true + fi else echo "We're on branch $BRANCH" VERSION="$BRANCH" fi -# Assume we're not tagging `latest` by default, and never on main. -TAG_LATEST=false -if [[ "$TAG" == "$HIGHEST" ]]; then - TAG_LATEST=true -else - echo "Building $BRANCH, not tagging latest" -fi - if [[ -z "$BUILDX_PLATFORMS" ]]; then BUILDX_PLATFORMS="linux/amd64,linux/arm64,linux/arm/v7,linux/ppc64le" fi