File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -229,8 +229,17 @@ get_latest_tag() {
229229 fi
230230 done
231231 if [ -z " $all_rcs " ]; then # couldn't find any version, returning latest release
232- echo " ${without_rc[@]} " | tr ' ' ' \n' | sort -r | head -n 1
233- return
232+ clean_versions=()
233+ # Removing tags that are not vX.Y.Z
234+ for v in " ${without_rc[@]} " ; do
235+ if [[ " $v " =~ ^v[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
236+ clean_versions+=(" $v " )
237+ fi
238+ done
239+ # Get the latest version (version sort)
240+ latest_version=$( printf " %s\n" " ${clean_versions[@]} " | sort -V | tail -n 1)
241+ echo " $latest_version "
242+ return
234243 else
235244 # trying to find matching rc
236245 # case mlrun doesnt have an rc (its a release) and demos doesn't have matching release (fetching latest rc)
You can’t perform that action at this time.
0 commit comments