pub enum EnvValue {
String(String),
Number(f64),
Boolean(bool),
}Expand description
Environment variable values are always strings, but GitHub Actions allows users to configure them as various native YAML types before internal stringification.
This type also gets used for other places where GitHub Actions contextually reinterprets a YAML value as a string, e.g. trigger input values.
Variants§
Implementations§
Source§impl EnvValue
impl EnvValue
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns whether the original value was empty.
For example, foo: and foo: '' would both return true.
Sourcepub fn csharp_bool(&self) -> bool
pub fn csharp_bool(&self) -> bool
Returns whether this EnvValue is a “trueish” value
per C#’s Boolean.TryParse.
This follows the semantics of C#’s Boolean.TryParse, where
the case-insensitive string “true” is considered true, but
“1”, “yes”, etc. are not.
Sourcepub fn actions_toolkit_bool(&self) -> Option<bool>
pub fn actions_toolkit_bool(&self) -> Option<bool>
Returns whether this EnvValue as a boolean according to the
rules for getBooleanInput in actions/toolkit.
Returns None if this value cannot be interpreted as a boolean according to those rules.
See: https://github.com/actions/toolkit/blob/b68d04/packages/core/src/core.ts#L198