RunnerContext

Struct RunnerContext 

Source
pub struct RunnerContext {
Show 13 fields pub github: Octocrab, pub owner: String, pub repo: String, pub commit_sha: Vec<u8>, pub commit_ref: Option<String>, pub global_dir_host: PathBuf, pub workflow_repo_path: String, pub run_id: RunId, pub run_number: i64, pub job_id: JobId, pub actor: String, pub token: String, pub override_env: Vec<(String, String)>,
}
Expand description

This contains various configuration values needed to run a Github Actions workflow. Most of these values are exposed to actions via standard GHA environment variables.

Fields§

§github: Octocrab

The Octocrab Github client used to fetch workflow resources. This can be configured with or without authentication; in the latter case all required resources must be public.

§owner: String

The Github owner name, e.g. Pernosco.

§repo: String

The Github repo name, e.g. github-actions-test.

§commit_sha: Vec<u8>

The repo commit-SHA decoded from hex, e.g. using hex::decode(sha_string.has_bytes()).

§commit_ref: Option<String>

An optional git ref for the commit. Exposed as $GITHUB_REF in the GHA steps.

§global_dir_host: PathBuf

A global working directory whose contents are exposed to all containers as /github. The runner will create files under this directory.

§workflow_repo_path: String

Name of workflow file in the repo, e.g. .github/workflows/build.yml.

§run_id: RunId

The workflow run ID. Exposed as $GITHUB_RUN_ID in the GHA steps. Can usually just be (e.g.) 1, but you might want to match the ID of some real workflow run.

§run_number: i64

The rerun number. Exposed as $GITHUB_RUN_NUMBER in the GHA steps. Can usually just be 1.

§job_id: JobId

The job ID. Exposed as $GITHUB_JOB in the GHA steps. Can usually just be 1.

§actor: String

Exposed as $GITHUB_ACTOR in the GHA steps.

§token: String

A Github personal access token for actions to use for checkouts and other Github operations. This must be valid. See zero_access_token() for a token you can use.

§override_env: Vec<(String, String)>

(key, value) pairs that override environment variable settings in a step. These are applied after all workflow-defined environment variables.

Trait Implementations§

Source§

impl Clone for RunnerContext

Source§

fn clone(&self) -> RunnerContext

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more