Disallow merge when required checked are missing (#29143) (#29268)

backport #29143

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Markus Amshove 2024-02-19 21:48:17 +01:00 committed by GitHub
parent c01b266d86
commit 78f41e4fc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 47 additions and 2 deletions

View file

@ -50,6 +50,10 @@ func MergeRequiredContextsCommitStatus(commitStatuses []*git_model.CommitStatus,
}
}
if matchedCount != len(requiredContexts) {
return structs.CommitStatusPending
}
if matchedCount == 0 {
status := git_model.CalcCommitStatus(commitStatuses)
if status != nil {