ActionTrait

Trait ActionTrait 

Source
pub trait ActionTrait {
Show 23 methods // Required methods fn init() -> Result<Self, ActionsError> where Self: Sized; fn name(&self) -> &str; fn description(&self) -> &str; // Provided methods fn get_input(key: impl Into<String> + Copy) -> Result<String, ActionsError> { ... } fn get_input_bool( key: impl Into<String> + Copy, ) -> Result<bool, ActionsError> { ... } fn get_input_int(key: impl Into<String> + Copy) -> Result<i32, ActionsError> { ... } fn get_input_vec( key: impl Into<String> + Copy, seperator: &str, ) -> Result<Vec<String>, ActionsError> { ... } fn set_output( key: impl Into<String>, value: impl Into<String>, ) -> Result<(), ActionsError> { ... } fn get_output_path() -> String { ... } fn get_server_url(&self) -> String { ... } fn get_api_url(&self) -> String { ... } fn get_graphql_url(&self) -> String { ... } fn get_token(&self) -> Result<String, ActionsError> { ... } fn get_sha(&self) -> Result<String, ActionsError> { ... } fn get_ref(&self) -> Result<String, ActionsError> { ... } fn get_ref_type(&self) -> Result<String, ActionsError> { ... } fn get_ref_name(&self) -> Result<String, ActionsError> { ... } fn get_event_name(&self) -> Result<String, ActionsError> { ... } fn get_repository(&self) -> Result<String, ActionsError> { ... } fn get_repository_owner(&self) -> Result<String, ActionsError> { ... } fn get_repository_name(&self) -> Result<String, ActionsError> { ... } fn get_repository_url(&self) -> Result<String, ActionsError> { ... } fn get_actor(&self) -> Result<String, ActionsError> { ... }
}
Expand description

Action Trait

Required Methods§

Source

fn init() -> Result<Self, ActionsError>
where Self: Sized,

Parse the action input

Source

fn name(&self) -> &str

Get the action name

Source

fn description(&self) -> &str

Get the action description

Provided Methods§

Source

fn get_input(key: impl Into<String> + Copy) -> Result<String, ActionsError>

Get the input value for a provided key

Source

fn get_input_bool(key: impl Into<String> + Copy) -> Result<bool, ActionsError>

Get the input value for a provided key as a boolean

Source

fn get_input_int(key: impl Into<String> + Copy) -> Result<i32, ActionsError>

Get the input value for a provided key as an integer

Source

fn get_input_vec( key: impl Into<String> + Copy, seperator: &str, ) -> Result<Vec<String>, ActionsError>

Get the input value for a provided key as a vector using a seperator

Source

fn set_output( key: impl Into<String>, value: impl Into<String>, ) -> Result<(), ActionsError>

Set the output value for a provided key

Source

fn get_output_path() -> String

Get the GitHub Actions Output File

https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Source

fn get_server_url(&self) -> String

GetHub Server URL (default: https://github.com)

Source

fn get_api_url(&self) -> String

GitHub API URL (default: https://api.github.com)

Source

fn get_graphql_url(&self) -> String

GitHub GraphQL URL (default: https://api.github.com/graphql)

Source

fn get_token(&self) -> Result<String, ActionsError>

Get the GitHub Token

Checks both the GITHUB_TOKEN and ACTIONS_RUNTIME_TOKEN environment variables

Source

fn get_sha(&self) -> Result<String, ActionsError>

Get the GitHub SHA

Source

fn get_ref(&self) -> Result<String, ActionsError>

Get the GitHub Ref (full)

Source

fn get_ref_type(&self) -> Result<String, ActionsError>

Get the GitHub Ref Type

Source

fn get_ref_name(&self) -> Result<String, ActionsError>

Get the GitHub Ref Name

Source

fn get_event_name(&self) -> Result<String, ActionsError>

Get the GitHub Workflow Event Name

Source

fn get_repository(&self) -> Result<String, ActionsError>

Get the full GitHub Repository (owner/repo)

Source

fn get_repository_owner(&self) -> Result<String, ActionsError>

Get the GitHub Repository owner name (org/user)

Source

fn get_repository_name(&self) -> Result<String, ActionsError>

Get the GitHub Repository name

Source

fn get_repository_url(&self) -> Result<String, ActionsError>

Get the GitHub Repository URL

Source

fn get_actor(&self) -> Result<String, ActionsError>

Get the Action Triggering Author

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§