{"record":{"id":"19f8a60310b9c461","repo":"nektos/act","slug":"sexpected-a-scalar-got-v","errorCode":null,"errorMessage":"%sExpected a scalar got %v","messagePattern":"(.+?)Expected a scalar got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/schema/schema.go","lineNumber":262,"sourceCode":"\t}\n\n\tisExpr, err := s.checkExpression(node)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif isExpr {\n\t\treturn nil\n\t}\n\tif def.Mapping != nil {\n\t\treturn s.checkMapping(node, def)\n\t} else if def.Sequence != nil {\n\t\treturn s.checkSequence(node, def)\n\t} else if def.OneOf != nil {\n\t\treturn s.checkOneOf(def, node)\n\t}\n\n\tif node.Kind != yaml.ScalarNode {\n\t\treturn fmt.Errorf(\"%sExpected a scalar got %v\", formatLocation(node), getStringKind(node.Kind))\n\t}\n\n\tif def.String != nil {\n\t\treturn s.checkString(node, def)\n\t} else if def.Number != nil {\n\t\tvar num float64\n\t\treturn node.Decode(&num)\n\t} else if def.Boolean != nil {\n\t\tvar b bool\n\t\treturn node.Decode(&b)\n\t} else if def.AllowedValues != nil {\n\t\ts := node.Value\n\t\tfor _, v := range *def.AllowedValues {\n\t\t\tif s == v {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\treturn fmt.Errorf(\"%sExpected one of %s got %s\", formatLocation(node), strings.Join(*def.AllowedValues, \",\"), s)","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/schema/schema.go#L244-L280","documentation":"Type error from Node.checkScalar (schema.go:262): the schema definition has no Mapping/Sequence/OneOf, so it expects a scalar, but the YAML node is a mapping, sequence, alias, or document node. The actual kind is rendered via getStringKind (document/sequence/mapping/scalar/alias/unknown).","triggerScenarios":"Providing a block where a scalar is required: putting a nested map under `name:`, a YAML list under `runs-on:`, or an anchor/alias node where a plain string is expected.","commonSituations":"Indentation mistakes that turn a value into a nested mapping; copy-pasting a multi-line snippet into a scalar field; using YAML anchors (&x/*x) in scalar positions.","solutions":["Go to the reported Line/Column and flatten the value to a scalar (plain string/number/bool)","Fix indentation so the value sits on the same logical line or as a quoted scalar","Replace anchors/aliases in scalar positions with literal values"],"exampleFix":"# before:\nruns-on:\n  - ubuntu-latest\n# after:\nruns-on: ubuntu-latest","handlingStrategy":"type-guard","validationCode":"# Keep constrained fields scalar: value on one line, or a quoted multi-line scalar (| / >) where allowed","typeGuard":"// YAML kind guard before validation:\nfunc isScalar(n *yaml.Node) bool { return n.Kind == yaml.ScalarNode }","tryCatchPattern":"Fatal validation error; restructure the YAML node to a scalar at the reported line/column.","preventionTips":["Watch indentation after a key — one extra space creates a mapping","Use yamllint to catch structure mistakes early","Quote scalar values that contain ':' or '-'"],"tags":["go","act","schema-validation","yaml","type-mismatch"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}