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§
Sourcefn init() -> Result<Self, ActionsError>where
Self: Sized,
fn init() -> Result<Self, ActionsError>where
Self: Sized,
Parse the action input
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get the action description
Provided Methods§
Sourcefn get_input(key: impl Into<String> + Copy) -> Result<String, ActionsError>
fn get_input(key: impl Into<String> + Copy) -> Result<String, ActionsError>
Get the input value for a provided key
Sourcefn get_input_bool(key: impl Into<String> + Copy) -> Result<bool, ActionsError>
fn get_input_bool(key: impl Into<String> + Copy) -> Result<bool, ActionsError>
Get the input value for a provided key as a boolean
Sourcefn get_input_int(key: impl Into<String> + Copy) -> Result<i32, ActionsError>
fn get_input_int(key: impl Into<String> + Copy) -> Result<i32, ActionsError>
Get the input value for a provided key as an integer
Sourcefn get_input_vec(
key: impl Into<String> + Copy,
seperator: &str,
) -> Result<Vec<String>, ActionsError>
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
Sourcefn set_output(
key: impl Into<String>,
value: impl Into<String>,
) -> Result<(), ActionsError>
fn set_output( key: impl Into<String>, value: impl Into<String>, ) -> Result<(), ActionsError>
Set the output value for a provided key
Sourcefn get_output_path() -> String
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/
Sourcefn get_server_url(&self) -> String
fn get_server_url(&self) -> String
GetHub Server URL (default: https://github.com)
Sourcefn get_api_url(&self) -> String
fn get_api_url(&self) -> String
GitHub API URL (default: https://api.github.com)
Sourcefn get_graphql_url(&self) -> String
fn get_graphql_url(&self) -> String
GitHub GraphQL URL (default: https://api.github.com/graphql)
Sourcefn get_token(&self) -> Result<String, ActionsError>
fn get_token(&self) -> Result<String, ActionsError>
Get the GitHub Token
Checks both the GITHUB_TOKEN and ACTIONS_RUNTIME_TOKEN environment variables
Sourcefn get_sha(&self) -> Result<String, ActionsError>
fn get_sha(&self) -> Result<String, ActionsError>
Get the GitHub SHA
Sourcefn get_ref(&self) -> Result<String, ActionsError>
fn get_ref(&self) -> Result<String, ActionsError>
Get the GitHub Ref (full)
Sourcefn get_ref_type(&self) -> Result<String, ActionsError>
fn get_ref_type(&self) -> Result<String, ActionsError>
Get the GitHub Ref Type
Sourcefn get_ref_name(&self) -> Result<String, ActionsError>
fn get_ref_name(&self) -> Result<String, ActionsError>
Get the GitHub Ref Name
Sourcefn get_event_name(&self) -> Result<String, ActionsError>
fn get_event_name(&self) -> Result<String, ActionsError>
Get the GitHub Workflow Event Name
Sourcefn get_repository(&self) -> Result<String, ActionsError>
fn get_repository(&self) -> Result<String, ActionsError>
Get the full GitHub Repository (owner/repo)
Sourcefn get_repository_owner(&self) -> Result<String, ActionsError>
fn get_repository_owner(&self) -> Result<String, ActionsError>
Get the GitHub Repository owner name (org/user)
Sourcefn get_repository_name(&self) -> Result<String, ActionsError>
fn get_repository_name(&self) -> Result<String, ActionsError>
Get the GitHub Repository name
Sourcefn get_repository_url(&self) -> Result<String, ActionsError>
fn get_repository_url(&self) -> Result<String, ActionsError>
Get the GitHub Repository URL
Sourcefn get_actor(&self) -> Result<String, ActionsError>
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.