{"record":{"id":"1812e0d328df3925","repo":"nektos/act","slug":"sexpected-a-mapping-got-v","errorCode":null,"errorMessage":"%sExpected a mapping got %v","messagePattern":"(.+?)Expected a mapping got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/schema/schema.go","lineNumber":364,"sourceCode":"\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 {\n\t\treturn fmt.Errorf(\"%sExpected a mapping got %v\", formatLocation(node), getStringKind(node.Kind))\n\t}\n\tinsertDirective := regexp.MustCompile(`\\${{\\s*insert\\s*}}`)\n\tvar allErrors error\n\tfor i, k := range node.Content {\n\t\tif i%2 == 0 {\n\t\t\tif insertDirective.MatchString(k.Value) {\n\t\t\t\tif len(s.Context) == 0 {\n\t\t\t\t\tallErrors = errors.Join(allErrors, fmt.Errorf(\"%sinsert is not allowed here\", formatLocation(k)))\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tisExpr, err := s.checkExpression(k)\n\t\t\tif err != nil {\n\t\t\t\tallErrors = errors.Join(allErrors, err)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif isExpr {","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/schema/schema.go#L346-L382","documentation":"Type error from Node.checkMapping (schema.go:364): the definition declares a Mapping but the YAML node is not yaml.MappingNode (e.g. a scalar or sequence appears where a key/value block is required).","triggerScenarios":"Putting a plain scalar or a list under a mapping-typed field, e.g. `with: docker://alpine` instead of key: value pairs, or `env: [A, B]` instead of a map.","commonSituations":"Missing key names in `with:`/`env:` blocks; collapsing a block mapping onto one line incorrectly; YAML flow syntax mistakes.","solutions":["Rewrite the value as key: value pairs under the field","Check indentation — mapping children must be indented consistently under their key"],"exampleFix":"# before:\nwith: docker://alpine:3.19\n# after:\nwith:\n  entrypoint: /bin/sh\n  args: -c 'echo hi'","handlingStrategy":"type-guard","validationCode":"# Mapping-typed fields (with:, env:, secrets:) must contain key: value pairs, indented under the key","typeGuard":"func isMapping(n *yaml.Node) bool { return n.Kind == yaml.MappingNode }","tryCatchPattern":"Fatal validation error — rewrite the value as a key/value block.","preventionTips":["Never put a scalar directly after with:/env: — always go to the next line with keys","Use yamllint and actionlint together on every workflow"],"tags":["go","act","schema-validation","yaml","mapping","type-mismatch"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}