You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-11-23 21:44:44 +02:00
Fix exclude path constraint behavior (#5042)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
This commit is contained in:
@@ -388,14 +388,19 @@ func (c *Path) Includes(v []string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Excludes returns true if the string matches any of the exclude patterns.
|
||||
// Excludes returns true if all of the strings match any of the exclude patterns.
|
||||
func (c *Path) Excludes(v []string) bool {
|
||||
for _, pattern := range c.Exclude {
|
||||
for _, file := range v {
|
||||
for _, file := range v {
|
||||
matched := false
|
||||
for _, pattern := range c.Exclude {
|
||||
if ok, _ := doublestar.Match(pattern, file); ok {
|
||||
return true
|
||||
matched = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !matched {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return false
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user