fix: filter out empty updaters in input (#235)

This commit is contained in:
Julian Tölle 2025-08-23 22:38:24 +02:00 committed by GitHub
parent f1aa1a2ef4
commit 5306e2dd35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -135,6 +135,10 @@ func parseUpdaters(input []string) []string {
names := []string{"changelog", "generic"} names := []string{"changelog", "generic"}
for _, u := range input { for _, u := range input {
if u == "" {
continue
}
if strings.HasPrefix(u, "-") { if strings.HasPrefix(u, "-") {
name := u[1:] name := u[1:]
names = slices.DeleteFunc(names, func(existingName string) bool { return existingName == name }) names = slices.DeleteFunc(names, func(existingName string) bool { return existingName == name })

View file

@ -89,6 +89,11 @@ func Test_parseUpdaters(t *testing.T) {
input: []string{"bar", "bar", "changelog"}, input: []string{"bar", "bar", "changelog"},
want: []string{"bar", "changelog", "generic"}, want: []string{"bar", "changelog", "generic"},
}, },
{
name: "remove empty entries",
input: []string{""},
want: []string{"changelog", "generic"},
},
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {