+ $SED -r 's/^.* ([0-9]*\.[0-9]*\.[0-9]*-SNAPSHOT).*$/\1/')
+
+ if [[ $branch == *master ]]
+ then
+ latest_released_tag=$(git -C "$repo_location/$repo" tag | \
+ grep '^[0-9]*\.[0-9]*\.[0-9]*$' | \
+ sort -V | \
+ tail -1)
+ else
+ # shellcheck disable=SC2001
+ latest_snapshot_major_minor=$(echo "$latest_snapshot_tag" | sed 's/\.[0-9]*-SNAPSHOT$//')
+ latest_released_tag=$(git -C "$repo_location/$repo" tag | \
+ grep '^[0-9]*\.[0-9]*\.[0-9]*$' | \
+ grep "$latest_snapshot_major_minor" | \
+ sort -V | \
+ tail -1)
+ fi