nektos/act · error
Unavailable context: jobs
Error message
Unavailable context: jobs
What it means
Thrown by evaluateVariable when an identifier is not one of the known contexts (github, env, job, jobs, steps, runner, secrets, vars, strategy, matrix, needs, inputs, infinity, nan). Any other root name in ${{ ... }} is rejected as an unavailable context.
Source
Thrown at pkg/exprparser/interpreter.go:163
return impl.evaluateLogicalCompare(node)
case *actionlint.FuncCallNode:
return impl.evaluateFuncCall(node)
default:
return nil, fmt.Errorf("Fatal error! Unknown node type: %s node: %+v", reflect.TypeOf(exprNode), exprNode)
}
}
func (impl *interperterImpl) evaluateVariable(variableNode *actionlint.VariableNode) (interface{}, error) {
switch strings.ToLower(variableNode.Name) {
case "github":
return impl.env.Github, nil
case "env":
return impl.env.Env, nil
case "job":
return impl.env.Job, nil
case "jobs":
if impl.env.Jobs == nil {
return nil, fmt.Errorf("Unavailable context: jobs")
}
return impl.env.Jobs, nil
case "steps":
return impl.env.Steps, nil
case "runner":
return impl.env.Runner, nil
case "secrets":
return impl.env.Secrets, nil
case "vars":
return impl.env.Vars, nil
case "strategy":
return impl.env.Strategy, nil
case "matrix":
return impl.env.Matrix, nil
case "needs":
return impl.env.Needs, nil
case "inputs":
return impl.env.Inputs, nilView on GitHub (pinned to 4f41128141)
Solutions
- Fix the name to a supported context, prefixing env vars with env. (e.g. ${{ env.GITHUB_SHA }}).
- Check the supported list in the interpreter and GitHub docs for the context you intended.
- Update act if the context is a newer GitHub addition.
- Run actionlint — it validates context names statically.
Example fix
# before
${{ MY_VAR == 'x' }}
# after
${{ env.MY_VAR == 'x' }} Defensive patterns
Strategy: validation
Validate before calling
var knownContexts = map[string]bool{'github': true, 'env': true, 'job': true, 'jobs': true, 'steps': true, 'runner': true, 'secrets': true, 'vars': true, 'strategy': true, 'matrix': true, 'needs': true, 'inputs': true}
func rootContextKnown(expr string) bool {
m := regexp.MustCompile(`^\$\{\{\s*([A-Za-z_][A-Za-z0-9_]*)`).FindStringSubmatch(expr)
return m != nil && knownContexts[m[1]]
} Prevention
- Reference env vars as env.NAME inside expressions
- Run actionlint to catch unknown contexts statically
- Check the supported context list when a GitHub release adds new ones
When it happens
Trigger: Typos like ${{ enviroment.X }} or ${{ GIT_SHA }}; shell variable usage inside expressions; using contexts only valid elsewhere (e.g. 'job' vs 'jobs' mix-ups); act-specific or newer GitHub contexts not yet implemented.
Common situations: Copying shell snippets into if:/run: expressions; expecting plain environment variables to resolve as bare identifiers (they must be env.NAME); version drift where GitHub added a context act lacks.
Related errors
- The following format string is invalid: '%s'
- The following format string references more arguments than w
- Unclosed brackets. The following format string is invalid: '
- Closing bracket without opening one. The following format st
- Cannot convert value to JSON. Cause: %v
AI-assisted analysis of nektos/act@4f41128141 (2026-08-15).
Data as JSON: /api/errors/6984e8d90b7b4651.
Report an issue: GitHub.