MCPcopy
hub / github.com/nektos/act / Skip

Function Skip

pkg/workflowpattern/workflow_pattern.go:151–174  ·  view source on GitHub ↗

returns true if the workflow should be skipped paths/branches

(sequence []*WorkflowPattern, input []string, traceWriter TraceWriter)

Source from the content-addressed store, hash-verified

149
150// returns true if the workflow should be skipped paths/branches
151func 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
177func Filter(sequence []*WorkflowPattern, input []string, traceWriter TraceWriter) bool {

Callers 1

TestMatchPatternFunction · 0.85

Calls 1

InfoMethod · 0.65

Tested by 1

TestMatchPatternFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…