Skip to content

Commit 5803118

Browse files
Merge pull request #619 from mlrun/fix
Fix
2 parents 5fdae23 + 1686dad commit 5803118

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

update_demos.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)