isPolicyCheck returns true if the check run name looks like a policy/account-gate check.
(name string)
| 308 | |
| 309 | // isPolicyCheck returns true if the check run name looks like a policy/account-gate check. |
| 310 | func isPolicyCheck(name string) bool { |
| 311 | lower := strings.ToLower(name) |
| 312 | for _, pattern := range policyCheckPatterns { |
| 313 | if strings.Contains(lower, pattern) { |
| 314 | return true |
| 315 | } |
| 316 | } |
| 317 | return false |
| 318 | } |
| 319 | |
| 320 | // filterCommitStatusesToPolicyChecks returns only the commit statuses whose context matches a policy/account-gate |
| 321 | // pattern. Used to compute required_state, which excludes optional third-party commit statuses |