returns true if the workflow should be skipped paths/branches
(sequence []*WorkflowPattern, input []string, traceWriter TraceWriter)
| 149 | |
| 150 | // returns true if the workflow should be skipped paths/branches |
| 151 | func Skip(sequence []*WorkflowPattern, input []string, traceWriter TraceWriter) bool { |
| 152 | if len(sequence) == 0 { |
| 153 | return false |
| 154 | } |
| 155 | for _, file := range input { |
| 156 | matched := false |
| 157 | for _, item := range sequence { |
| 158 | if item.Regex.MatchString(file) { |
| 159 | pattern := item.Pattern |
| 160 | if item.Negative { |
| 161 | matched = false |
| 162 | traceWriter.Info("%s excluded by pattern %s", file, pattern) |
| 163 | } else { |
| 164 | matched = true |
| 165 | traceWriter.Info("%s included by pattern %s", file, pattern) |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | if matched { |
| 170 | return false |
| 171 | } |
| 172 | } |
| 173 | return true |
| 174 | } |
| 175 | |
| 176 | // returns true if the workflow should be skipped paths-ignore/branches-ignore |
| 177 | func Filter(sequence []*WorkflowPattern, input []string, traceWriter TraceWriter) bool { |
searching dependent graphs…