#[non_exhaustive]pub struct ProtectionState {Show 13 fields
pub present: bool,
pub enforced: bool,
pub covers_default_branch: bool,
pub requires_pull_request: bool,
pub required_checks: Vec<String>,
pub blocks_force_push: bool,
pub blocks_deletion: bool,
pub bypass_actors: Vec<String>,
pub other_gaps: Vec<ProtectionGap>,
pub check_source_guard: CheckSourceGuard,
pub protected_paths: Vec<String>,
pub merge_methods: Option<Vec<MergeMethod>>,
pub ci_enabled: Option<bool>,
}Expand description
The default-branch protection that makes the check mean something, as
observed. Each flag is the protective state, so Default is “nothing
protected”.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.present: boolThe managed rule (ruleset, branch protection) exists.
enforced: boolIt is enforced, not disabled or in evaluate-only mode.
covers_default_branch: boolIt covers the default branch.
requires_pull_request: boolChanges must come through a pull request.
required_checks: Vec<String>Status checks the rule requires (by context name).
blocks_force_push: boolForce-pushes are blocked.
blocks_deletion: boolBranch deletion is blocked.
bypass_actors: Vec<String>Actors allowed to bypass it. Must be empty (§5.3).
other_gaps: Vec<ProtectionGap>Shortfalls in what keeps the check’s own workflow out of the change under test’s reach (a namespace required workflow, owner review), which the fields above cannot express. The adapter fills this in.
check_source_guard: CheckSourceGuardWhich guard keeps the check out of the pull request’s reach.
protected_paths: Vec<String>Paths a pull request may not change (forge glob syntax), for a forge that protects the workflow this way. Empty when not read.
merge_methods: Option<Vec<MergeMethod>>The merge methods the repository allows, for an adapter that reads
them. None: not observed.
ci_enabled: Option<bool>Whether the forge’s CI is enabled on the repository, for an adapter
that reads it. None: not observed.