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, nil

View on GitHub (pinned to 4f41128141)

Solutions

  1. Fix the name to a supported context, prefixing env vars with env. (e.g. ${{ env.GITHUB_SHA }}).
  2. Check the supported list in the interpreter and GitHub docs for the context you intended.
  3. Update act if the context is a newer GitHub addition.
  4. 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

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


AI-assisted analysis of nektos/act@4f41128141 (2026-08-15). Data as JSON: /api/errors/6984e8d90b7b4651. Report an issue: GitHub.