Skip to content

Commit

Permalink
Merge pull request #1 from beatlabs/improve-tag-discovery
Browse files Browse the repository at this point in the history
release-changelog: Improve discovery of previous release tag
  • Loading branch information
hwoarang authored Oct 20, 2020
2 parents abce875 + a49f29d commit 190ae35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion release-changelog
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ git_fetch() {

git_previous_tag() {
local previous_tag
previous_tag=$(eval git tag --sort=version:refname | grep -v "$(git describe --tags)" | grep -E "${TAG_REGEX}"| tail -n1)
# shellcheck disable=SC2046 disable=SC2086
previous_tag=$(eval git tag --sort=version:refname | grep -v $(git tag --contains $(git rev-parse HEAD) | grep -E ${TAG_REGEX}) | grep -E "${TAG_REGEX}" | tail -n1)

# If there is no tag, just get the first commit on repo
[[ -z ${previous_tag} ]] && previous_tag=$(git rev-list --max-parents=0 HEAD)
Expand Down

0 comments on commit 190ae35

Please sign in to comment.