{"record":{"id":"5564c37dc2360938","repo":"nektos/act","slug":"the-runs-using-key-in-action-yml-must-be-one-of","errorCode":null,"errorMessage":"The runs.using key in action.yml must be one of: %v, got %s","messagePattern":"The runs\\.using key in action\\.yml must be one of: (.+?), got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/action.go","lineNumber":27,"sourceCode":"\t\"gopkg.in/yaml.v3\"\n)\n\n// ActionRunsUsing is the type of runner for the action\ntype ActionRunsUsing string\n\nfunc (a *ActionRunsUsing) UnmarshalYAML(unmarshal func(interface{}) error) error {\n\tvar using string\n\tif err := unmarshal(&using); err != nil {\n\t\treturn err\n\t}\n\n\t// Force input to lowercase for case insensitive comparison\n\tformat := ActionRunsUsing(strings.ToLower(using))\n\tswitch format {\n\tcase ActionRunsUsingNode24, ActionRunsUsingNode20, ActionRunsUsingNode16, ActionRunsUsingNode12, ActionRunsUsingDocker, ActionRunsUsingComposite:\n\t\t*a = format\n\tdefault:\n\t\treturn fmt.Errorf(\"The runs.using key in action.yml must be one of: %v, got %s\", []string{\n\t\t\tActionRunsUsingComposite,\n\t\t\tActionRunsUsingDocker,\n\t\t\tActionRunsUsingNode12,\n\t\t\tActionRunsUsingNode16,\n\t\t\tActionRunsUsingNode20,\n\t\t\tActionRunsUsingNode24,\n\t\t}, format)\n\t}\n\treturn nil\n}\n\nconst (\n\t// ActionRunsUsingNode12 for running with node12\n\tActionRunsUsingNode12 = \"node12\"\n\t// ActionRunsUsingNode16 for running with node16\n\tActionRunsUsingNode16 = \"node16\"\n\t// ActionRunsUsingNode20 for running with node20\n\tActionRunsUsingNode20 = \"node20\"","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/model/action.go#L9-L45","documentation":"Returned by ActionRunsUsing.UnmarshalYAML when an action's metadata `runs.using` key (after lowercasing) is not one of node12, node16, node20, node24, docker, or composite. This is the model-level gate that runs during YAML decoding of action.yml/action.yaml, before the action is ever executed.","triggerScenarios":"A local or remote action declares `using: node18` (never a valid value), `using: node` (truncated), or a typo like `using: compsite`. Because comparison is case-insensitive after ToLower, `Node20` is fine but any unrecognized string fails.","commonSituations":"Actions authored for GitHub runner versions act does not support yet; typos in hand-written action.yml; actions generated by tooling that emits newer/older runtime identifiers; copying an action.yml template and forgetting to update the using key.","solutions":["Set `using:` to a supported value: node20, node24, node12, node16, docker, or composite.","For JavaScript actions on an unsupported runtime (e.g. node18-only), use node20 — GitHub-compatible and accepted by act.","If the action is third-party, pin a tag/commit of that action whose action.yml uses a supported runtime, or vendor and patch it locally."],"exampleFix":"# before\nruns:\n  using: 'node18'\n  main: 'index.js'\n# after\nruns:\n  using: 'node20'\n  main: 'index.js'","handlingStrategy":"validation","validationCode":"var validUsing = map[string]bool{\"node12\": true, \"node16\": true, \"node20\": true, \"node24\": true, \"docker\": true, \"composite\": true}\nfunc checkUsing(ymlPath string) error {\n    var a struct{ Runs struct{ Using string `yaml:\"using\"` } `yaml:\"runs\"` }\n    b, _ := os.ReadFile(ymlPath)\n    if err := yaml.Unmarshal(b, &a); err != nil { return err }\n    if !validUsing[strings.ToLower(a.Runs.Using)] {\n        return fmt.Errorf(\"unsupported using %q\", a.Runs.Using)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin action.yml templates to using: node20 (or composite/docker).","Validate action metadata in CI with a schema or lint step before the act run.","Never invent runtime values like node18 — check the supported list for your act version."],"tags":["action","yaml","runs-using","validation"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}