mirror of
https://github.com/harness/drone.git
synced 2025-05-05 05:01:46 +08:00
remove branch rule: all status checks must succeed (#691)
This commit is contained in:
parent
d2b971c49a
commit
c0849b7b36
@ -103,16 +103,6 @@ func (v *Branch) CanMerge(_ context.Context, in CanMergeInput) (CanMergeOutput,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if v.PullReq.StatusChecks.AllMustSucceed {
|
|
||||||
for i := range in.Checks {
|
|
||||||
if in.Checks[i].Status != enum.CheckStatusSuccess {
|
|
||||||
violations.Add("pullreq.status_checks.all_must_succeed",
|
|
||||||
"All status checks must complete successfully.")
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// pullreq.merge
|
// pullreq.merge
|
||||||
|
|
||||||
if len(v.PullReq.Merge.StrategiesAllowed) > 0 { // Note: Empty allowed strategies list means all are allowed
|
if len(v.PullReq.Merge.StrategiesAllowed) > 0 { // Note: Empty allowed strategies list means all are allowed
|
||||||
@ -177,8 +167,7 @@ func (v DefComments) Validate() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type DefStatusChecks struct {
|
type DefStatusChecks struct {
|
||||||
RequireUIDs []string `json:"require_uids,omitempty"`
|
RequireUIDs []string `json:"require_uids,omitempty"`
|
||||||
AllMustSucceed bool `json:"all_must_succeed,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v DefStatusChecks) Validate() error {
|
func (v DefStatusChecks) Validate() error {
|
||||||
|
Loading…
Reference in New Issue
Block a user