Skip to content

Commit

Permalink
add correct version sort
Browse files Browse the repository at this point in the history
  • Loading branch information
obezpalko committed Jun 19, 2024
1 parent 6b6602c commit b0eb96a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion get-new-tag/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ runs:
tag="$( git tag --list "${new_tag}" )"
if [ -n "${tag}" ] ; then
# tag found, we need increase patch
latest_tag_patch="$( git tag --list "${parent_prefix}.${parent_minor:-0}.*${parent_extra}" | tail -n 1 | sed -r 's/^[^.][0-9]*\.[0-9]+\.([0-9]+)[^0-9]?.*$/\1/' )"
latest_tag_patch="$( git tag --list "${parent_prefix}.${parent_minor:-0}.*${parent_extra}" | sort --version-sort | tail -n 1 | sed -r 's/^[^.][0-9]*\.[0-9]+\.([0-9]+)[^0-9]?.*$/\1/' )"
new_tag="${parent_prefix}.${parent_minor:-0}.$(( ${latest_tag_patch:-0} + ${{ inputs.increment }} ))${parent_extra}"
fi
echo "tag=${new_tag}" | tee -a "${GITHUB_OUTPUT}"
Expand Down

0 comments on commit b0eb96a

Please sign in to comment.