From fda8fa733d1212c882bb212a535439bcb8e62fd5 Mon Sep 17 00:00:00 2001 From: Marko Gacesa Date: Wed, 25 Oct 2023 12:16:47 +0000 Subject: [PATCH] fix branch.lifecycle rule violation codes (#719) --- app/services/protection/rule_branch.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/services/protection/rule_branch.go b/app/services/protection/rule_branch.go index 8482a76ae..99e1dd013 100644 --- a/app/services/protection/rule_branch.go +++ b/app/services/protection/rule_branch.go @@ -119,17 +119,17 @@ func (v *Branch) CanModifyRef(_ context.Context, in CanModifyRefInput) ([]types. switch in.RefAction { case RefActionCreate: if v.Lifecycle.CreateForbidden { - violations.Addf("pullreq.lifecycle.create", + violations.Addf("lifecycle.create", "Creation of branch %q is not allowed.", in.RefNames[0]) } case RefActionDelete: if v.Lifecycle.DeleteForbidden { - violations.Addf("pullreq.lifecycle.delete", + violations.Addf("lifecycle.delete", "Delete of branch %q is not allowed.", in.RefNames[0]) } case RefActionUpdate: 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]) } }