Skip to content

Commit 5d43b45

Browse files
ti-chi-botwuhuizuo
andauthored
fix(pkg/tide): change branch matching to use prefix matching instead of (#29)
exact match Co-authored-by: wuhuizuo <wuhuizuo@126.com>
1 parent 22232db commit 5d43b45

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/tide/status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ func requirementDiff(pr *PullRequest, q *config.TideQuery, cc contextChecker) (s
146146
// for the correct branch.
147147
targetBranchDenied := false
148148
for _, excludedBranch := range q.ExcludedBranches {
149-
if string(pr.BaseRef.Name) == excludedBranch {
149+
if strings.HasPrefix(string(pr.BaseRef.Name), excludedBranch) {
150150
targetBranchDenied = true
151151
break
152152
}
153153
}
154154
// if no allowlist is configured, the target is OK by default
155155
targetBranchAllowed := len(q.IncludedBranches) == 0
156156
for _, includedBranch := range q.IncludedBranches {
157-
if string(pr.BaseRef.Name) == includedBranch {
157+
if strings.HasPrefix(string(pr.BaseRef.Name), includedBranch) {
158158
targetBranchAllowed = true
159159
break
160160
}

0 commit comments

Comments
 (0)