View Source GitHubActions.Config (GitHubActions v0.2.26)
A simple keyword-based configuration API.
Examples
This module is used to define the configuration for GitHubActions
.
import GitHubActions.Config
config :linux,
name: "Ubuntu",
runs_on: "ubuntu-20.04"
config key: "value"
Summary
Functions
Returns the configuration.
Adds the given data to the configuration.
Adds the given value
to the configuration under the given key
.
Returns the value for key
or keys
in a tuple.
Returns the value for key
or keys
.
Returns the value for key
or keys
.
Reads the configuration from the given path
.
Types
Functions
@spec config() :: config()
Returns the configuration.
Adds the given data to the configuration.
Returns the configuration that was previously stored.
Adds the given value
to the configuration under the given key
.
Returns the configuration that was previously stored.
Returns the value for key
or keys
in a tuple.
If the configuration parameter does not exist, the function returns error
.
Examples
iex> Config.fetch(:jobs)
{:ok, [:linux]}
iex> Config.fetch(:foo)
:error
iex> Config.fetch([:linux, :name])
{:ok, "Ubuntu"}
Returns the value for key
or keys
.
Examples
iex> Config.fetch!(:jobs)
[:linux]
iex> Config.fetch!([:linux, :runs_on])
"ubuntu-20.04"
iex> Config.fetch!([:linux, :foo])
** (KeyError) key :foo not found in: [name: "Ubuntu", runs_on: "ubuntu-20.04"]
Returns the value for key
or keys
.
If the configuration parameter does not exist, the function returns the default value.
Examples
iex> Config.get(:jobs)
[:linux]
iex> Config.get(:foo, :bar)
:bar
iex> Config.get([:linux, :runs_on])
"ubuntu-20.04"
iex> Config.get(:foo)
nil
@spec read(Path.t()) :: :ok | {:error, :enonet}
Reads the configuration from the given path
.