pub struct BranchProtection {Show 24 fields
pub rule_name: String,
pub apply_to_admins: Option<bool>,
pub approvals_whitelist_teams: Option<Vec<String>>,
pub approvals_whitelist_username: Option<Vec<String>>,
pub block_on_official_review_requests: Option<bool>,
pub block_on_outdated_branch: Option<bool>,
pub block_on_rejected_reviews: Option<bool>,
pub dismiss_stale_approvals: Option<bool>,
pub enable_approvals_whitelist: Option<bool>,
pub enable_merge_whitelist: Option<bool>,
pub enable_push: Option<bool>,
pub enable_push_whitelist: Option<bool>,
pub enable_status_check: Option<bool>,
pub ignore_stale_approvals: Option<bool>,
pub merge_whitelist_teams: Option<Vec<String>>,
pub merge_whitelist_usernames: Option<Vec<String>>,
pub protected_file_patterns: Option<String>,
pub push_whitelist_deploy_keys: Option<bool>,
pub push_whitelist_teams: Option<Vec<String>>,
pub push_whitelist_usernames: Option<Vec<String>>,
pub require_signed_commits: Option<bool>,
pub required_approvals: Option<i64>,
pub status_check_contexts: Option<Vec<String>>,
pub unprotected_file_patterns: Option<String>,
}Expand description
The subset of the BranchProtection response the CLI reads.
Open in the same way as super::Repository. created_at is deliberately
not vendored: the response already arrives in the order Forgejo consults the
rules in, so nothing here has to reconstruct it from a timestamp.
Fields§
§rule_name: StringThe rule’s name.
apply_to_admins: Option<bool>Whether the protection also applies to repository administrators.
approvals_whitelist_teams: Option<Vec<String>>The teams whose approvals count, when the approvals whitelist is on.
approvals_whitelist_username: Option<Vec<String>>The users whose approvals count, when the approvals whitelist is on.
block_on_official_review_requests: Option<bool>Whether an official code owner review request blocks merging until resolved.
block_on_outdated_branch: Option<bool>Whether merging is blocked while the branch is behind its base.
block_on_rejected_reviews: Option<bool>Whether a requested change blocks merging until it is resolved.
dismiss_stale_approvals: Option<bool>Whether a new commit dismisses existing approvals.
enable_approvals_whitelist: Option<bool>Whether only the approvals whitelist counts toward the required approvals.
enable_merge_whitelist: Option<bool>Whether only the merge whitelist may merge.
enable_push: Option<bool>Whether direct pushes to the branch are allowed at all.
enable_push_whitelist: Option<bool>Whether only the push whitelist may push.
enable_status_check: Option<bool>Whether status checks must pass before merging.
ignore_stale_approvals: Option<bool>Whether approvals on an outdated commit stop counting.
merge_whitelist_teams: Option<Vec<String>>The teams that may merge, when the merge whitelist is on.
merge_whitelist_usernames: Option<Vec<String>>The users that may merge, when the merge whitelist is on.
protected_file_patterns: Option<String>Semicolon separated glob patterns for files that only whitelisted pushers may change.
push_whitelist_deploy_keys: Option<bool>Whether deploy keys may push, when the push whitelist is on.
push_whitelist_teams: Option<Vec<String>>The teams that may push, when the push whitelist is on.
push_whitelist_usernames: Option<Vec<String>>The users that may push, when the push whitelist is on.
require_signed_commits: Option<bool>Whether every commit on the branch must be signed.
required_approvals: Option<i64>The number of approving reviews required before merging.
status_check_contexts: Option<Vec<String>>The status check contexts that must report success.
unprotected_file_patterns: Option<String>Semicolon separated glob patterns for files that any pusher may change despite the protected patterns.
Implementations§
Source§impl BranchProtection
impl BranchProtection
Sourcepub fn push_access(&self) -> Option<PushAccess>
pub fn push_access(&self) -> Option<PushAccess>
The push access the two wire flags describe, when Forgejo reported both.
Trait Implementations§
Source§impl Clone for BranchProtection
impl Clone for BranchProtection
Source§fn clone(&self) -> BranchProtection
fn clone(&self) -> BranchProtection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more