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: OctocrabThe 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: StringThe Github owner name, e.g. Pernosco.
repo: StringThe 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: PathBufA global working directory whose contents are exposed to all containers as /github.
The runner will create files under this directory.
workflow_repo_path: StringName of workflow file in the repo, e.g. .github/workflows/build.yml.
run_id: RunIdThe 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: i64The rerun number. Exposed as $GITHUB_RUN_NUMBER in the GHA steps. Can usually
just be 1.
job_id: JobIdThe job ID. Exposed as $GITHUB_JOB in the GHA steps. Can usually just be 1.
actor: StringExposed as $GITHUB_ACTOR in the GHA steps.
token: StringA 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
impl Clone for RunnerContext
Source§fn clone(&self) -> RunnerContext
fn clone(&self) -> RunnerContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for RunnerContext
impl !RefUnwindSafe for RunnerContext
impl Send for RunnerContext
impl Sync for RunnerContext
impl Unpin for RunnerContext
impl !UnwindSafe for RunnerContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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