Skip to main content

StepAction

Enum StepAction 

Source
#[non_exhaustive]
pub enum StepAction { WriteFile { path: String, contents: Vec<u8>, message: String, }, SetVariable { name: String, value: String, }, ProtectDefaultBranch(ProtectionSpec), RequireNamespaceWorkflow { contents: Vec<u8>, check: String, message: String, }, RequireOwnerReview { paths: Vec<String>, owners: Vec<ForgeAccount>, community_rules: Vec<u8>, message: String, }, RemoveFile { path: String, message: String, }, RemoveVariable { name: String, }, ConfigureRepo(RepoSettings), RefreshProtectedFiles { files: Vec<ExtraFile>, message: String, }, }
Expand description

What a step does.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

WriteFile

Make a file on the default branch have exactly these contents.

Fields

§path: String

Repository-relative path.

§contents: Vec<u8>

Desired contents.

§message: String

Commit message if a commit is needed.

§

SetVariable

Make a CI variable have this value.

Fields

§name: String

Variable name.

§value: String

Desired value.

§

ProtectDefaultBranch(ProtectionSpec)

Enforce protection on the default branch.

§

RequireNamespaceWorkflow

Run the check from a workflow the namespace holds outside the repository, pinned to a revision, and require it on this repository’s default branch. The change under test cannot alter what checks it (§9: the PR must not be able to satisfy its own check).

Fields

§contents: Vec<u8>

The workflow’s contents.

§check: String

The check (job) name it reports, for inspection.

§message: String

Commit message if the workflow has to be (re)written.

§

RequireOwnerReview

Make every change to paths need an approving review from one of owners — the fallback where no namespace-level workflow is available (§9). The adapter resolves each account’s current login at run time; the numeric id is what is planned.

Fields

§paths: Vec<String>

Repository paths (directories end in /), e.g. /.github/.

§owners: Vec<ForgeAccount>

Who may approve. Never empty.

§community_rules: Vec<u8>

The community’s own owner rules, in the forge’s format, kept ahead of the managed rule (which therefore wins for paths). Rules already in the repository take their place when present.

§message: String

Commit message if the rules have to be (re)written.

§

RemoveFile

Make sure a file is absent from the default branch (clean-up after a change of guard).

Fields

§path: String

Repository-relative path.

§message: String

Commit message if a commit is needed.

§

RemoveVariable

Make sure a CI variable is absent.

Fields

§name: String

Variable name.

§

ConfigureRepo(RepoSettings)

Make the repository’s settings (merge methods, CI) match.

§

RefreshProtectedFiles

Rewrite files the default branch’s protection forbids changing — the managed workflow, the exempt keyring — through a temporary exception for the bridge alone, restoring the protection exactly afterwards (and attempting to even when a write failed). A maintenance job, not part of a bootstrap: it is the one sanctioned way the bridge changes a protected path, so it runs as one audited step.

Fields

§files: Vec<ExtraFile>

The files, each with its desired contents.

§message: String

Commit message for each file that changes.

Trait Implementations§

Source§

impl Clone for StepAction

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StepAction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for StepAction

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for StepAction

Source§

impl PartialEq for StepAction

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for StepAction

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for StepAction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.