feat(filters): regex match release support list (#265)

This commit is contained in:
Ludvig Lundgren 2022-05-03 15:26:13 +02:00 committed by GitHub
parent 8b1174c65f
commit 9d52d42440
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View file

@ -319,13 +319,21 @@ func (f Filter) checkSizeFilter(r *Release, minSize string, maxSize string) bool
return true
}
func matchRegex(tag string, filter string) bool {
re, err := regexp.Compile(`(?i)(?:` + filter + `)`)
if err != nil {
return false
func matchRegex(tag string, filterList string) bool {
filters := strings.Split(filterList, ",")
for _, filter := range filters {
re, err := regexp.Compile(`(?i)(?:` + filter + `)`)
if err != nil {
return false
}
match := re.MatchString(tag)
if match {
return true
}
}
return re.MatchString(tag)
return false
}
// checkFilterIntStrings "1,2,3-20"