@@ -28,23 +28,28 @@ func PrMatchesCriteria(branch string, prLabels []string) bool {
28
28
29
29
// checks if a branch matches the branch filtering criteria
30
30
func branchMatchesCriteria (branch string ) bool {
31
+ Logger .Debug ("Checking branch criteria" , "branch" , branch )
31
32
// Do not attempt to match on existing branches that were created by this CLI
32
33
if branch == combineBranchName {
34
+ Logger .Debug ("Branch is a combine branch, skipping match" )
33
35
return false
34
36
}
35
37
36
38
// If no branch filters are specified, all branches pass this check
37
39
if branchPrefix == "" && branchSuffix == "" && branchRegex == "" {
40
+ Logger .Debug ("No branch filters specified, passing match" )
38
41
return true
39
42
}
40
43
41
44
// Apply branch prefix filter if specified
42
45
if branchPrefix != "" && ! strings .HasPrefix (branch , branchPrefix ) {
46
+ Logger .Debug ("Branch does not match prefix" , "prefix" , branchPrefix , "branch" , branch )
43
47
return false
44
48
}
45
49
46
50
// Apply branch suffix filter if specified
47
51
if branchSuffix != "" && ! strings .HasSuffix (branch , branchSuffix ) {
52
+ Logger .Debug ("Branch does not match suffix" , "suffix" , branchSuffix , "branch" , branch )
48
53
return false
49
54
}
50
55
@@ -57,10 +62,12 @@ func branchMatchesCriteria(branch string) bool {
57
62
}
58
63
59
64
if ! regex .MatchString (branch ) {
65
+ Logger .Debug ("Branch does not match regex" , "regex" , branchRegex , "branch" , branch )
60
66
return false
61
67
}
62
68
}
63
69
70
+ Logger .Debug ("Branch matches all branch criteria" , "branch" , branch )
64
71
return true
65
72
}
66
73
0 commit comments