aboutsummaryrefslogtreecommitdiffstats
path: root/models/git/protected_branch.go
diff options
context:
space:
mode:
authorTim <tim@datenknoten.me>2024-10-23 06:39:43 +0200
committerGitHub <noreply@github.com>2024-10-23 12:39:43 +0800
commitde2ad2e1b177ed1c3412761c54b28579f8ecbb00 (patch)
treea8124fa2c61116adfe96e41b89335202c2955b55 /models/git/protected_branch.go
parent620f19610ef747412a9e4265c6b20fa560663f17 (diff)
downloadgitea-de2ad2e1b177ed1c3412761c54b28579f8ecbb00.tar.gz
gitea-de2ad2e1b177ed1c3412761c54b28579f8ecbb00.zip
Make admins adhere to branch protection rules (#32248)
This introduces a new flag `BlockAdminMergeOverride` on the branch protection rules that prevents admins/repo owners from bypassing branch protection rules and merging without approvals or failing status checks. Fixes #17131 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'models/git/protected_branch.go')
-rw-r--r--models/git/protected_branch.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/models/git/protected_branch.go b/models/git/protected_branch.go
index bde6057375..0033a42d4e 100644
--- a/models/git/protected_branch.go
+++ b/models/git/protected_branch.go
@@ -63,6 +63,7 @@ type ProtectedBranch struct {
RequireSignedCommits bool `xorm:"NOT NULL DEFAULT false"`
ProtectedFilePatterns string `xorm:"TEXT"`
UnprotectedFilePatterns string `xorm:"TEXT"`
+ BlockAdminMergeOverride bool `xorm:"NOT NULL DEFAULT false"`
CreatedUnix timeutil.TimeStamp `xorm:"created"`
UpdatedUnix timeutil.TimeStamp `xorm:"updated"`