Skip to content

Commit

Permalink
Merge pull request #106 from ywk253100/220221_push_patch
Browse files Browse the repository at this point in the history
Bug fixing, only check whether the tag is the latest version when tag isn't empty
  • Loading branch information
reasonerjt authored Feb 21, 2022
2 parents 1b8209b + 8fdce05 commit c2ea672
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions hack/docker-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

# Debugging info
echo "Highest tag found: $HIGHEST"
echo "BRANCH: $BRANCH"
Expand Down

0 comments on commit c2ea672

Please sign in to comment.