Documentation
¶
Overview ¶
Package exprparser evaluates the source of one `${{ }}` expression against the contexts and the functions that GitHub Actions defines. The layer above it, expreval, finds those expressions in a workflow value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallsStatusFunction ¶
func CallsStatusFunction(exprNode actionlint.ExprNode) bool
CallsStatusFunction reports whether the expression calls a status function, which counts as the expression asking its own status question instead of the default one.
func CoerceToString ¶
CoerceToString converts an evaluated expression value to a string the way GitHub does, see https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#operators An already reflected value is accepted as-is, since Interface() would panic on an invalid one.
Types ¶
type DefaultStatusCheck ¶
type DefaultStatusCheck int
const ( DefaultStatusCheckNone DefaultStatusCheck = iota DefaultStatusCheckSuccess DefaultStatusCheckAlways DefaultStatusCheckCanceled DefaultStatusCheckFailure )
func (DefaultStatusCheck) String ¶
func (dsc DefaultStatusCheck) String() string
type EvaluationEnvironment ¶
type EvaluationEnvironment struct {
Github *model.GithubContext
Env map[string]string
Job *model.JobContext
Jobs *map[string]*model.WorkflowCallResult
Steps map[string]*model.StepResult
Runner map[string]any
Secrets map[string]string
Vars map[string]string
Strategy map[string]any
Matrix map[string]any
Needs map[string]Needs
Inputs map[string]any
HashFiles func([]reflect.Value) (any, error)
}
type Interpreter ¶
type Interpreter interface {
Evaluate(input string, defaultStatusCheck DefaultStatusCheck) (any, error)
}
func NewInterpeter ¶
func NewInterpeter(env *EvaluationEnvironment, config Config) Interpreter