Skip to content

Commit

Permalink
Use intelligent version sorting for tags
Browse files Browse the repository at this point in the history
Use git's `version:refname` sorting when listing tags to sort them as version numbers.
  • Loading branch information
imgrant authored and StephaneBour committed Jun 1, 2022
1 parent bbba373 commit e8848d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ NEXT_RELEASE=$(date "+${DATE_FORMAT}")

# ColemanB - Script looks for tags meeting requirements
# and then looks up hash.
LAST_RELEASE=$(git tag |grep "^20[^\-]*$" |sort -r |head -n 1)
LAST_RELEASE=$(git tag --sort=v:refname |grep "^20[^\-]*$" |tail -n 1)
echo "Last release : ${LAST_RELEASE}"

LAST_HASH="$(git show-ref -s "${LAST_RELEASE}")"
Expand Down

0 comments on commit e8848d7

Please sign in to comment.