0
0
mirror of https://github.com/thegeeklab/git-sv.git synced 2024-09-19 13:52:45 +02:00

feat: possiblity to filter for relevant git tags

issue: #45
This commit is contained in:
hypervtechnics 2022-03-07 16:11:07 +01:00
parent 946024ce0b
commit b1b47747c1
3 changed files with 5 additions and 3 deletions

View File

@ -89,6 +89,7 @@ versioning: # versioning bump
tag:
pattern: '%d.%d.%d' # Pattern used to create git tag.
filter: '' # Enables you to filter for considerable tags using git pattern syntax
release-notes:
# Deprecated!!! please use 'sections' instead!

View File

@ -63,6 +63,7 @@ type VersioningConfig struct {
// TagConfig tag preferences.
type TagConfig struct {
Pattern string `yaml:"pattern"`
Filter string `yaml:"filter"`
}
// ==== Release Notes ====

View File

@ -15,8 +15,8 @@ import (
)
const (
logSeparator = "##"
endLine = "~~"
logSeparator = "###"
endLine = "~~~"
)
// Git commands.
@ -144,7 +144,7 @@ func (g GitImpl) Tag(version semver.Version) (string, error) {
// Tags list repository tags.
func (g GitImpl) Tags() ([]GitTag, error) {
cmd := exec.Command("git", "for-each-ref", "--sort", "creatordate", "--format", "%(creatordate:iso8601)#%(refname:short)", "refs/tags")
cmd := exec.Command("git", "for-each-ref", "--sort", "creatordate", "--format", "%(creatordate:iso8601)#%(refname:short)", "refs/tags/" + g.tagCfg.Filter)
out, err := cmd.CombinedOutput()
if err != nil {
return nil, combinedOutputErr(err, out)