nektos/act · error

%sExpected one of %s got %s

Error message

%sExpected one of %s got %s

What it means

Enum error from Node.checkScalar (schema.go:280): the schema declares an AllowedValues list and the scalar's value does not match any entry. The expected list is joined with commas and the actual value appended.

Source

Thrown at pkg/schema/schema.go:280

		return fmt.Errorf("%sExpected a scalar got %v", formatLocation(node), getStringKind(node.Kind))
	}

	if def.String != nil {
		return s.checkString(node, def)
	} else if def.Number != nil {
		var num float64
		return node.Decode(&num)
	} else if def.Boolean != nil {
		var b bool
		return node.Decode(&b)
	} else if def.AllowedValues != nil {
		s := node.Value
		for _, v := range *def.AllowedValues {
			if s == v {
				return nil
			}
		}
		return fmt.Errorf("%sExpected one of %s got %s", formatLocation(node), strings.Join(*def.AllowedValues, ","), s)
	} else if def.Null != nil {
		var myNull *byte
		return node.Decode(&myNull)
	}
	return errors.ErrUnsupported
}

func (s *Node) checkString(node *yaml.Node, def Definition) error {
	val := node.Value
	if def.String.Constant != "" && def.String.Constant != val {
		return fmt.Errorf("%sExpected %s got %s", formatLocation(node), def.String.Constant, val)
	}
	if def.String.IsExpression {
		parser := actionlint.NewExprParser()
		lexer := actionlint.NewExprLexer(val + "}}")
		exprNode, parseErr := parser.Parse(lexer)
		if parseErr != nil {
			return fmt.Errorf("%sFailed to parse: %s", formatLocation(node), parseErr.Message)

View on GitHub (pinned to 4f41128141)

Solutions

  1. Change the value to one of the comma-separated options shown in the error
  2. If the value is valid on GitHub but missing from act's schema, update the schema JSON or report an issue
  3. Quote the value to ensure YAML does not reinterpret it (true/false/null coercion)

Example fix

# before:
runs-on: ubutnu-latest
# after:
runs-on: ubuntu-latest
Defensive patterns

Strategy: validation

Validate before calling

// Validate enum-ish fields against your org's allowed list before committing, mirroring schema AllowedValues

Try / catch

Deterministic validation failure — pick a value from the comma list in the message.

Prevention

When it happens

Trigger: Setting a constrained field to an out-of-list value, e.g. `runs-on: notalabel` when the schema restricts to ubuntu-latest/macos-latest, or a misspelled boolean-like enum value.

Common situations: Typos in enum fields; self-hosted runner labels not present in the schema's allowed list; newer GitHub values not yet added to act's schema.

Related errors


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