{"record":{"id":"c85a13920471fcd3","repo":"nektos/act","slug":"sexpected-a-sequence-got-v","errorCode":null,"errorMessage":"%sExpected a sequence got %v","messagePattern":"(.+?)Expected a sequence got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/schema/schema.go","lineNumber":345,"sourceCode":"\tswitch k {\n\tcase yaml.DocumentNode:\n\t\treturn \"document\"\n\tcase yaml.SequenceNode:\n\t\treturn \"sequence\"\n\tcase yaml.MappingNode:\n\t\treturn \"mapping\"\n\tcase yaml.ScalarNode:\n\t\treturn \"scalar\"\n\tcase yaml.AliasNode:\n\t\treturn \"alias\"\n\tdefault:\n\t\treturn \"unknown\"\n\t}\n}\n\nfunc (s *Node) checkSequence(node *yaml.Node, def Definition) error {\n\tif node.Kind != yaml.SequenceNode {\n\t\treturn fmt.Errorf(\"%sExpected a sequence got %v\", formatLocation(node), getStringKind(node.Kind))\n\t}\n\tvar allErrors error\n\tfor _, v := range node.Content {\n\t\tallErrors = errors.Join(allErrors, (&Node{\n\t\t\tDefinition: def.Sequence.ItemType,\n\t\t\tSchema:     s.Schema,\n\t\t\tContext:    append(append([]string{}, s.Context...), s.Schema.GetDefinition(def.Sequence.ItemType).Context...),\n\t\t}).UnmarshalYAML(v))\n\t}\n\treturn allErrors\n}\n\nfunc formatLocation(node *yaml.Node) string {\n\treturn fmt.Sprintf(\"Line: %v Column %v: \", node.Line, node.Column)\n}\n\nfunc (s *Node) checkMapping(node *yaml.Node, def Definition) error {\n\tif node.Kind != yaml.MappingNode {","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/schema/schema.go#L327-L363","documentation":"Type error from Node.checkSequence (schema.go:345): the definition declares a Sequence but the YAML node's Kind is not yaml.SequenceNode. The actual kind name (document/sequence/mapping/scalar/alias) is included.","triggerScenarios":"Providing a scalar or mapping where the schema requires a list: `needs: build` style is fine only if schema allows oneOf; pure sequence fields (e.g. a list-typed env value) given `key: value` or a bare scalar.","commonSituations":"Forgetting the dash/list syntax; indentation making a list item a nested map; converting a single-value shorthand into a block map.","solutions":["Convert the value to a YAML sequence (dash-prefixed items or inline [a, b])","Fix indentation so each item is a list entry, not a mapping key"],"exampleFix":"# before:\nmatrix:\n  os:\n    linux: true\n# after:\nmatrix:\n  os:\n    - linux\n    - macos","handlingStrategy":"type-guard","validationCode":"# Write list fields with explicit dash syntax or inline [a, b] flow style","typeGuard":"func isSequence(n *yaml.Node) bool { return n.Kind == yaml.SequenceNode }","tryCatchPattern":"Fatal validation error — convert the node to a sequence at the reported position.","preventionTips":["Each list item starts with '- ' at the same indentation","Run yamllint to catch accidental mappings under list fields"],"tags":["go","act","schema-validation","yaml","sequence","type-mismatch"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}