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 /modules | |
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 'modules')
-rw-r--r-- | modules/structs/repo_branch.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/structs/repo_branch.go b/modules/structs/repo_branch.go index 0f2cf482fd..12a8344e87 100644 --- a/modules/structs/repo_branch.go +++ b/modules/structs/repo_branch.go @@ -52,6 +52,7 @@ type BranchProtection struct { RequireSignedCommits bool `json:"require_signed_commits"` ProtectedFilePatterns string `json:"protected_file_patterns"` UnprotectedFilePatterns string `json:"unprotected_file_patterns"` + BlockAdminMergeOverride bool `json:"block_admin_merge_override"` // swagger:strfmt date-time Created time.Time `json:"created_at"` // swagger:strfmt date-time @@ -90,6 +91,7 @@ type CreateBranchProtectionOption struct { RequireSignedCommits bool `json:"require_signed_commits"` ProtectedFilePatterns string `json:"protected_file_patterns"` UnprotectedFilePatterns string `json:"unprotected_file_patterns"` + BlockAdminMergeOverride bool `json:"block_admin_merge_override"` } // EditBranchProtectionOption options for editing a branch protection @@ -121,4 +123,5 @@ type EditBranchProtectionOption struct { RequireSignedCommits *bool `json:"require_signed_commits"` ProtectedFilePatterns *string `json:"protected_file_patterns"` UnprotectedFilePatterns *string `json:"unprotected_file_patterns"` + BlockAdminMergeOverride *bool `json:"block_admin_merge_override"` } |