Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
Fix unmatched release tag name bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Burak Olgun committed Jul 17, 2020
1 parent fb1e4b3 commit dc62139
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions helpers/repository_metric_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ func GetTagDateRangeTotalCommits(repo *git.Repository, tagCommits []tagCommit) [

func IsReleaseTag(tagName, releaseTagPattern string) bool {
var lowerTagName = strings.ToLower(tagName)
matched, err := regexp.MatchString(releaseTagPattern, lowerTagName)
var lowerReleaseTagPattern = strings.ToLower(releaseTagPattern)
matched, err := regexp.MatchString(lowerReleaseTagPattern, lowerTagName)
if err != nil {
println(err)
}
Expand All @@ -167,7 +168,7 @@ func getTagCommitBetweenDates(r *git.Repository, request MetricsRequest) ([]tagC
lastTagFound := false
firstTagFound := false
for _, t := range sortedTagList {
if !IsReleaseTag(string(t.tag.Name()), request.ReleaseTagPattern) {
if !IsReleaseTag(t.tag.Name().Short(), request.ReleaseTagPattern) {
continue
}

Expand Down

0 comments on commit dc62139

Please sign in to comment.