Documentation
¶
Overview ¶
Package actionsexpr evaluates GitHub Actions workflow expressions for tests that must ask what GitHub would DO with a committed workflow, not merely whether a string is present in it. A substring assertion passes a predicate that has been rewritten to mean something else; evaluating it cannot.
It is test support, imported only by _test.go files, on the internal/gittest and internal/testsecret precedent: the workflow contracts live in more than one package (core/lint holds the repository's own workflows, and core/launch/scaffold the templates a managed repository is scaffolded from), and an evaluator spelled twice is one the two can disagree about.
It implements the slice of the expression language the workflows here use, and it fails CLOSED on the rest: an unknown context path or an unsupported function is an error the caller reports as a failure, never a guessed value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvalIf ¶
EvalIf evaluates a job's or a step's `if:` condition the way GitHub decides whether to run it. The value may be written bare or as one `${{ }}` expression. A condition that names no status-check function is evaluated as `success() && (<condition>)`, GitHub's implicit default, which is what skips a job whose need failed or was skipped however its own condition reads; the context therefore states success() whenever it is asked about such a condition.
func EvalValue ¶
EvalValue evaluates one YAML value the way GitHub would, in the given expression context: a bare `true`/`false`, a value that is exactly one `${{ }}` expression (which keeps its own type), or a string with expressions interpolated into it.
Types ¶
This section is empty.