pontil/core
Gleaming GitHub Actions
pontil | ˈpɒntɪl | (punty | ˈpʌnti |) noun
(in glass-making) an iron rod used to hold or shape soft glass.
pontil/core is a port of core functionality from the GitHub actions/toolkit to Gleam. This targets both JavaScript and the BEAM. This library is intended to be used by a higher-level API surface and its use directly is discouraged.
Types
Optional properties that can be sent with output annotation commands
(notice, error, and warning). See create a check run for more
information about annotations.
pub type AnnotationProperties =
command.AnnotationProperties
The exit code for an action.
pub type ExitCode =
command.ExitCode
Options for reading input values in an action.
pub type InputOptions =
command.InputOptions
Errors returned by pontil_core functions.
pub type PontilCoreError =
command.PontilCoreError
Values
pub fn add_path(
input_path: String,
) -> Result(Nil, command.PontilCoreError)
Prepends input_path to the PATH (for this action and future actions).
pub fn describe_error(error: command.PontilCoreError) -> String
Returns a human-readable description of a pontil/core error.
pub fn error_annotation(
msg message: String,
props props: List(command.AnnotationProperties),
) -> Nil
Adds an error issue with annotation options.
pub fn export_variable(
name name: String,
value value: String,
) -> Result(Nil, command.PontilCoreError)
Sets env variable for this action and future actions in the job.
pub fn get_boolean_input(
name: String,
) -> Result(Bool, command.PontilCoreError)
Gets the input value of the boolean type in the YAML 1.2 “core schema”
specification. Supported boolean values are true, True, TRUE,
false, False, or FALSE.
pub fn get_boolean_input_opts(
name name: String,
opts opts: List(command.InputOptions),
) -> Result(Bool, command.PontilCoreError)
Gets the input value of the boolean type in the YAML 1.2 “core schema”
specification. Supported boolean values are true, True,
TRUE, false, False, or FALSE.
pub fn get_input(name: String) -> String
Gets a GitHub Action input value with default options.
pub fn get_input_opts(
name name: String,
opts opts: List(command.InputOptions),
) -> Result(String, command.PontilCoreError)
Gets a GitHub Action input value with provided options.
pub fn get_multiline_input(name: String) -> List(String)
Gets the values of a multiline input with default options. Each value is also trimmed.
pub fn get_multiline_input_opts(
name name: String,
opts opts: List(command.InputOptions),
) -> Result(List(String), command.PontilCoreError)
Gets the values of a multiline input with provided options.
pub fn get_state(name: String) -> String
Gets the value of state set by this action’s main execution.
pub fn group(name name: String, do action: fn() -> a) -> a
Wraps an action function in an output group.
pub fn notice_annotation(
msg message: String,
props props: List(command.AnnotationProperties),
) -> Nil
Adds a notice issue with annotation options.
pub fn save_state(
name name: String,
value value: String,
) -> Result(Nil, command.PontilCoreError)
Saves state for current action, the state can only be retrieved by this action’s post job execution.
pub fn set_command_echo(enabled: Bool) -> Nil
Enable or disable the echoing of commands into stdout for the rest of the step.
pub fn set_failed(message: String) -> Nil
Writes the message as an error and sets the action status to failed.
pub fn set_output(
name name: String,
value value: String,
) -> Result(Nil, command.PontilCoreError)
Sets the value of an output for passing values between steps or jobs.
pub fn set_secret(secret: String) -> String
Registers a secret which will get masked from logs.
Returns the input value so it can be used as the last expression in a pipeline:
Ok(set_secret("mypassword")) // => Ok("mypassword")
pub fn to_platform_path(path: String) -> String
Converts the given path to the platform-specific form.
pub fn to_posix_path(path: String) -> String
Converts the given path to posix form (\\ → /).
pub fn to_win32_path(path: String) -> String
Converts the given path to win32 form (/ → \\).
pub fn warning_annotation(
msg message: String,
props props: List(command.AnnotationProperties),
) -> Nil
Adds a warning issue with annotation options.