fix: 🐛 use latest instead of last (oldest) tag
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
aca8272527
commit
a7f7cfbc65
25
card.json
Normal file
25
card.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"type": "AdaptiveCard",
|
||||||
|
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
|
||||||
|
"version": "1.5",
|
||||||
|
"body": [
|
||||||
|
{
|
||||||
|
"type": "TextBlock",
|
||||||
|
"text": "${title}",
|
||||||
|
"wrap": true,
|
||||||
|
"style": "heading"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "TextBlock",
|
||||||
|
"text": "Tag: ${tag}",
|
||||||
|
"wrap": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"type": "Action.OpenUrl",
|
||||||
|
"title": "View release",
|
||||||
|
"url": "${url}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -77,25 +77,19 @@ func getLatestGitTag(options ...GetLatestGitTagOption) (tag string, err error) {
|
|||||||
return "", fmt.Errorf("error getting git tag refs %w", err)
|
return "", fmt.Errorf("error getting git tag refs %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for {
|
ref, err := tagRefs.Next()
|
||||||
r, err := tagRefs.Next()
|
|
||||||
|
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
break
|
return tag, fmt.Errorf("couldn't find any git tags %w", err)
|
||||||
}
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return "", fmt.Errorf("error iterating tags %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
parts := strings.Split(string(r.Name()), "/")
|
|
||||||
tag = strings.Join(parts[2:], "/")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if tag == "" {
|
if err != nil {
|
||||||
return tag, fmt.Errorf("couldn't find any git tags")
|
return tag, fmt.Errorf("error iterating tags %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parts := strings.Split(string(ref.Name()), "/")
|
||||||
|
tag = strings.Join(parts[2:], "/")
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user