mirror of
https://github.com/harness/drone.git
synced 2025-05-21 19:39:59 +08:00
fix branch.lifecycle rule violation codes (#719)
This commit is contained in:
parent
66ac5e3a5c
commit
fda8fa733d
@ -119,17 +119,17 @@ func (v *Branch) CanModifyRef(_ context.Context, in CanModifyRefInput) ([]types.
|
|||||||
switch in.RefAction {
|
switch in.RefAction {
|
||||||
case RefActionCreate:
|
case RefActionCreate:
|
||||||
if v.Lifecycle.CreateForbidden {
|
if v.Lifecycle.CreateForbidden {
|
||||||
violations.Addf("pullreq.lifecycle.create",
|
violations.Addf("lifecycle.create",
|
||||||
"Creation of branch %q is not allowed.", in.RefNames[0])
|
"Creation of branch %q is not allowed.", in.RefNames[0])
|
||||||
}
|
}
|
||||||
case RefActionDelete:
|
case RefActionDelete:
|
||||||
if v.Lifecycle.DeleteForbidden {
|
if v.Lifecycle.DeleteForbidden {
|
||||||
violations.Addf("pullreq.lifecycle.delete",
|
violations.Addf("lifecycle.delete",
|
||||||
"Delete of branch %q is not allowed.", in.RefNames[0])
|
"Delete of branch %q is not allowed.", in.RefNames[0])
|
||||||
}
|
}
|
||||||
case RefActionUpdate:
|
case RefActionUpdate:
|
||||||
if v.Lifecycle.UpdateForbidden {
|
if v.Lifecycle.UpdateForbidden {
|
||||||
violations.Addf("pullreq.lifecycle.update",
|
violations.Addf("lifecycle.update",
|
||||||
"Push to branch %q is not allowed. Please use pull requests.", in.RefNames[0])
|
"Push to branch %q is not allowed. Please use pull requests.", in.RefNames[0])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user