Skip to content

Commit

Permalink
Sorting by commiterdate
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Moya de Rivas committed Sep 9, 2020
1 parent 332f1c9 commit 0263c1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ git fetch --tags
# get latest tag that looks like a semver (with or without v)
case "$tag_context" in
*repo*)
tag=$(git for-each-ref --sort=-v:refname --format '%(refname)' | cut -d / -f 3- | grep -E "^v?[0-9]+.[0-9]+.[0-9]+$" | head -n1)
pre_tag=$(git for-each-ref --sort=-v:refname --format '%(refname)' | cut -d / -f 3- | grep -E "^v?[0-9]+.[0-9]+.[0-9]+(-$suffix.[0-9]+)?$" | head -n1)
tag=$(git for-each-ref --sort=-committerdate --format '%(refname)' | cut -d / -f 3- | grep -E "^v?[0-9]+.[0-9]+.[0-9]+$" | head -n1)
pre_tag=$(git for-each-ref --sort=-committerdate --format '%(refname)' | cut -d / -f 3- | grep -E "^v?[0-9]+.[0-9]+.[0-9]+(-$suffix.[0-9]+)?$" | head -n1)
;;
*branch*)
tag=$(git tag --list --merged HEAD --sort=-committerdate | grep -E "^v?[0-9]+.[0-9]+.[0-9]+$" | head -n1)
pre_tag=$(git tag --list --sort=-committerdate | grep -E "^v?[0-9]+.[0-9]+.[0-9]+(-$suffix.[0-9]+)?$" | head -n1)
pre_tag=$(git tag --list --merged HEAD --sort=-committerdate | grep -E "^v?[0-9]+.[0-9]+.[0-9]+(-$suffix.[0-9]+)?$" | head -n1)
;;
* ) echo "Unrecognised context"; exit 1;;
esac
Expand Down

0 comments on commit 0263c1f

Please sign in to comment.