pontil
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 is a port of actions/toolkit to Gleam.
At the moment, it covers most of the functionality of @actions/core (only
getIdToken is currently unimplemented). This will grow over time.
It nominally works with both Erlang and JavaScript targets, but as non-composite GitHub Actions run with a Node runtime, JavaScript compatibility is highest priority.
None of the current functionality requires gleam_javascript for Promise support.
Values
pub fn add_path(
input_path: String,
) -> Result(Nil, errors.PontilError)
Prepends input_path to the PATH (for this action and future actions).
pub fn describe_error(error: errors.PontilError) -> String
Returns a human-readable description of a pontil error.
pub fn error_with_properties(
msg message: String,
props props: List(types.AnnotationProperties),
) -> Nil
Adds an error issue
pub fn export_variable(
name name: String,
value value: String,
) -> Result(Nil, errors.PontilError)
Sets env variable for this action and future actions in the job
pub fn get_boolean_input(
name: String,
) -> Result(Bool, errors.PontilError)
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_with_options(
name name: String,
opts opts: types.InputOptions,
) -> Result(Bool, errors.PontilError)
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_with_options(
name name: String,
opts opts: types.InputOptions,
) -> Result(String, errors.PontilError)
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_with_options(
name name: String,
opts opts: types.InputOptions,
) -> Result(List(String), errors.PontilError)
Gets the values of a multiline input with provided options.
pub fn get_state(name: String) -> String
Gets the value of an state set by this action’s main execution.
pub fn group(name name: String, do action: fn() -> a) -> a
Wraps an action in an output group.
pub fn group_start(name: String) -> Nil
Begin an output group.
Output until the next group_end will be foldable in this group.
pub fn notice_with_properties(
msg message: String,
props props: List(types.AnnotationProperties),
) -> Nil
Adds a notice issue
pub fn save_state(
name name: String,
value value: String,
) -> Result(Nil, errors.PontilError)
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. Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
pub fn set_failed(message: String) -> Nil
Sets the action status to failed. When the action exits it will be with an exit code of 1.
pub fn set_output(
name name: String,
value value: String,
) -> Result(Nil, errors.PontilError)
Sets the value of an output for passing values between steps or jobs.
See Passing job outputs, steps context, and outputs for JavaScript
actions.
pub fn set_secret(secret: String) -> Nil
Registers a secret which will get masked from logs
This function instructs the Actions runner to mask the specified value in any logs produced during the workflow run. Once registered, the secret value will be replaced with asterisks (***) whenever it appears in console output, logs, or error messages.
This is useful for protecting sensitive information such as:
- API keys
- Access tokens
- Authentication credentials
- URL parameters containing signatures (SAS tokens)
Note that masking only affects future logs; any previous appearances of the secret in logs before calling this function will remain unmasked.
For security purposes, if the environment variable
GITHUB_ACTIONSis not"true", the actual secret will not be printed as it is likely that the action is being tested outside of GitHub Actions.
pub fn stop() -> Nil
Stops the process with the exit code set by set_exit_code.
This does not have a corresponding function in GitHub @actions/core.
With an Erlang runner, this reads the exit code from the process dictionary and calls
erlang:halt/1. On JavaScript, this is a no-op because process.exitCode is already
set by set_exit_code.
pub fn to_platform_path(path: String) -> String
to_platform_path converts the given path to a platform-specific path. It does this by
replacing instances of / and \\ with the platform-specific path separator.
If possible, prefer using the filepath library.
pub fn to_posix_path(path: String) -> String
to_posix_path converts the given path to the posix form. On Windows, \\ will be
replaced with /.
If possible, prefer using the filepath library.
pub fn to_win32_path(path: String) -> String
to_win32_path converts the given path to the win32 form. On Linux, / will be
replaced with \\.
If possible, prefer using the filepath library.
pub fn warning_with_properties(
msg message: String,
props props: List(types.AnnotationProperties),
) -> Nil
Adds a warning issue