nektos/act · error

%sExpected got

Error message

%sExpected %s got %s

What it means

Constant-match error from Node.checkString (schema.go:291): the schema declares String.Constant (a required fixed string) and the node's value differs. Used to enforce literal magic values in specific positions of the workflow schema.

Solutions

  1. Set the value to the expected constant shown in the error message
  2. If you intended a different construct, check the schema for the correct key/structure to use instead

Example fix

# before (schema expects the fixed keyword):
do: x-custom-action
# after:
do: x-action
Defensive patterns

Strategy: validation

Try / catch

Fatal validation error — set the value to the exact expected constant from the message.

Prevention

When it happens

Trigger: A field where the schema pins one exact string (e.g. a discriminator key like `uses: docker://` sub-parts or a fixed `do:` keyword) receives any other value.

Common situations: Editing generated or templated workflows and changing fixed keywords; schema drift where the constant changed between act versions.

Related errors


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

Appendix: source

Thrown at pkg/schema/schema.go:291

	} 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)
		}
		cerr := s.checkSingleExpression(exprNode)
		if cerr != nil {
			return fmt.Errorf("%s%w", formatLocation(node), cerr)
		}
	}
	return nil
}

func (s *Node) checkOneOf(def Definition, node *yaml.Node) error {
	var allErrors error

View on GitHub (pinned to 4f41128141)