View Source GitHubActions.Project (GitHubActions v0.3.2)

A thin wrapper for Mix.Project to access the config.

Summary

Functions

Returns the Elixir version of the current project.

Returns the value for given keys from the project config, in a tuple.

Returns the value for given keys from the project config, raises an error if keys are not available.

Returns the value for given keys from the project config.

Returns true if the given dep is part of the project.

Types

default()

@type default() :: any()

key()

@type key() :: atom()

keys()

@type keys() :: [atom()]

value()

@type value() :: any()

Functions

config()

See Mix.Project.config/0.

elixir()

@spec elixir() :: String.t()

Returns the Elixir version of the current project.

Examples

iex> Project.elixir()
"~> 1.13"

fetch(keys)

@spec fetch(key() | keys()) :: {:ok, value()} | :error

Returns the value for given keys from the project config, in a tuple.

Examples

iex> Project.fetch(:app)
{:ok, :git_hub_actions}

iex> Project.fetch(:unknown)
:error

iex> Project.fetch([:test_coverage, :tool])
{:ok, ExCoveralls}

fetch!(keys)

@spec fetch!(key() | keys()) :: value()

Returns the value for given keys from the project config, raises an error if keys are not available.

Examples

iex> Project.fetch!(:app)
:git_hub_actions

iex> Project.fetch!([:test_coverage, :tool])
ExCoveralls

get(keys, default \\ nil)

@spec get(key() | keys(), default()) :: value()

Returns the value for given keys from the project config.

Examples

iex> Project.get(:app)
:git_hub_actions

iex> Project.get(:unknown, 42)
42

iex> Project.get([:test_coverage, :tool])
ExCoveralls

has_dep?(dep)

@spec has_dep?(atom()) :: boolean()

Returns true if the given dep is part of the project.

Examples

iex> Project.has_dep?(:credo)
true

iex> Project.has_dep?(:datix)
false