diff options
author | Tim <tim@datenknoten.me> | 2024-10-23 06:39:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-23 12:39:43 +0800 |
commit | de2ad2e1b177ed1c3412761c54b28579f8ecbb00 (patch) | |
tree | a8124fa2c61116adfe96e41b89335202c2955b55 /routers/web/repo/setting/protected_branch.go | |
parent | 620f19610ef747412a9e4265c6b20fa560663f17 (diff) | |
download | gitea-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 'routers/web/repo/setting/protected_branch.go')
-rw-r--r-- | routers/web/repo/setting/protected_branch.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/web/repo/setting/protected_branch.go b/routers/web/repo/setting/protected_branch.go index 7d943fd434..940a138aff 100644 --- a/routers/web/repo/setting/protected_branch.go +++ b/routers/web/repo/setting/protected_branch.go @@ -256,6 +256,7 @@ func SettingsProtectedBranchPost(ctx *context.Context) { protectBranch.ProtectedFilePatterns = f.ProtectedFilePatterns protectBranch.UnprotectedFilePatterns = f.UnprotectedFilePatterns protectBranch.BlockOnOutdatedBranch = f.BlockOnOutdatedBranch + protectBranch.BlockAdminMergeOverride = f.BlockAdminMergeOverride err = git_model.UpdateProtectBranch(ctx, ctx.Repo.Repository, protectBranch, git_model.WhitelistOptions{ UserIDs: whitelistUsers, |