{"record":{"id":"cc7ab4014569ca76","repo":"nektos/act","slug":"actions-yaml-schema-validation-error-detected-nfo","errorCode":null,"errorMessage":"Actions YAML Schema Validation Error detected:\\nFor more information, see: https://nektosact.com/usage/schema.html","messagePattern":"Actions YAML Schema Validation Error detected:\\\\nFor more information, see: https://nektosact\\.com/usage/schema\\.html","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/workflow.go","lineNumber":81,"sourceCode":"\t\tif !decodeNode(w.RawOn, &val) {\n\t\t\treturn nil\n\t\t}\n\t\treturn val[event]\n\t}\n\treturn nil\n}\n\nfunc (w *Workflow) UnmarshalYAML(node *yaml.Node) error {\n\t// Resolve yaml anchor aliases first\n\tif err := resolveAliases(node); err != nil {\n\t\treturn err\n\t}\n\t// Validate the schema before deserializing it into our model\n\tif err := (&schema.Node{\n\t\tDefinition: \"workflow-root\",\n\t\tSchema:     schema.GetWorkflowSchema(),\n\t}).UnmarshalYAML(node); err != nil {\n\t\treturn errors.Join(err, fmt.Errorf(\"Actions YAML Schema Validation Error detected:\\nFor more information, see: https://nektosact.com/usage/schema.html\"))\n\t}\n\ttype WorkflowDefault Workflow\n\treturn node.Decode((*WorkflowDefault)(w))\n}\n\ntype WorkflowStrict Workflow\n\nfunc (w *WorkflowStrict) UnmarshalYAML(node *yaml.Node) error {\n\t// Resolve yaml anchor aliases first\n\tif err := resolveAliases(node); err != nil {\n\t\treturn err\n\t}\n\t// Validate the schema before deserializing it into our model\n\tif err := (&schema.Node{\n\t\tDefinition: \"workflow-root-strict\",\n\t\tSchema:     schema.GetWorkflowSchema(),\n\t}).UnmarshalYAML(node); err != nil {\n\t\treturn errors.Join(err, fmt.Errorf(\"Actions YAML Strict Schema Validation Error detected:\\nFor more information, see: https://nektosact.com/usage/schema.html\"))","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/model/workflow.go#L63-L99","documentation":"Workflow.UnmarshalYAML first validates the raw YAML node against act's JSON schema (definition workflow-root) before decoding. On validation failure it joins the schema error(s) with this hint pointing at the schema documentation. The underlying schema errors in the joined chain identify the exact failing node paths.","triggerScenarios":"Any workflow whose top-level structure violates the schema: unknown root keys, wrong types (e.g. `on:` as a non-mapping when a mapping is required), invalid job structure, or bad step shape.","commonSituations":"Workflows using GitHub features act's vendored schema does not know; typos at top level (`job:` instead of `jobs:`); tool-generated YAML with unexpected wrapper keys.","solutions":["Unwrap errors.Join output to see each schema violation and its path.","Fix each flagged key per https://nektosact.com/usage/schema.html.","If the key is genuinely valid on GitHub but rejected by act's schema, report it upstream and temporarily remove the key locally."],"exampleFix":"# before\non:\n  push\njobs: {}\n# after\non:\n  push: {}\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - run: echo ok","handlingStrategy":"validation","validationCode":"// quick structural pre-check before handing a file to act\nvar probe map[string]interface{}\nif err := yaml.Unmarshal(raw, &probe); err != nil { return err }\nif _, ok := probe[\"jobs\"]; !ok { return fmt.Errorf(\"workflow missing 'jobs' key\") }","typeGuard":null,"tryCatchPattern":"if err != nil {\n    var joined interface{ Unwrap() []error }\n    if errors.As(err, &joined) {\n        for _, e := range joined.Unwrap() { log.Error(e) } // per-node schema errors\n    }\n}","preventionTips":["Validate workflows against the published act/GitHub JSON schema in your editor.","Run act plan-only (`act -n`) in CI to catch schema issues early.","Treat unknown-key warnings from actionlint as fix-now, not later."],"tags":["workflow","schema","yaml","validation"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}