expr

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalBool

func EvalBool(condition string, ctx *Context) bool

EvalBool evaluates an if: condition string against ctx. Strips the ${{ }} wrapper if present, then delegates to evalExpr.

func Expand

func Expand(s string, ctx *Context) string

Expand replaces all ${{ … }} expressions in s using ctx. Unknown expressions resolve to "".

Types

type Context

type Context struct {
	Env     map[string]string
	Secrets map[string]string
	Matrix  map[string]string
	Inputs  map[string]string
	Github  map[string]string            // github.sha, github.ref, github.repository, …
	Needs   map[string]map[string]string // needs.JOB.outputs.KEY
	Steps   map[string]map[string]string // steps.ID.outputs.KEY
	Job     map[string]string            // job.status
}

Context holds all namespaced values available for expression expansion.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL