{"record":{"id":"92870982a15dba36","repo":"nektos/act","slug":"the-runs-using-key-must-be-one-of-v-got-s","errorCode":null,"errorMessage":"The runs.using key must be one of: %v, got %s","messagePattern":"The runs\\.using key must be one of: (.+?), got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runner/action.go","lineNumber":202,"sourceCode":"\t\t\tlogger.Debugf(\"executing remote job container: %s\", containerArgs)\n\n\t\t\trc.ApplyExtraPath(ctx, step.getEnv())\n\n\t\t\treturn rc.execJobContainer(containerArgs, *step.getEnv(), \"\", \"\")(ctx)\n\t\tcase x.IsDocker():\n\t\t\tif remoteAction == nil {\n\t\t\t\tactionDir = \"\"\n\t\t\t\tactionPath = containerActionDir\n\t\t\t}\n\t\t\treturn execAsDocker(ctx, step, actionName, actionDir, actionPath, remoteAction == nil, \"entrypoint\")\n\t\tcase x.IsComposite():\n\t\t\tif err := maybeCopyToActionDir(ctx, step, actionDir, actionPath, containerActionDir); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\treturn execAsComposite(step)(ctx)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"The runs.using key must be one of: %v, got %s\", []string{\n\t\t\t\tmodel.ActionRunsUsingDocker,\n\t\t\t\tmodel.ActionRunsUsingNode12,\n\t\t\t\tmodel.ActionRunsUsingNode16,\n\t\t\t\tmodel.ActionRunsUsingNode20,\n\t\t\t\tmodel.ActionRunsUsingNode24,\n\t\t\t\tmodel.ActionRunsUsingComposite,\n\t\t\t}, action.Runs.Using)\n\t\t}\n\t}\n}\n\nfunc setupActionEnv(ctx context.Context, step actionStep, _ *remoteAction) error {\n\trc := step.getRunContext()\n\n\t// A few fields in the environment (e.g. GITHUB_ACTION_REPOSITORY)\n\t// are dependent on the action. That means we can complete the\n\t// setup only after resolving the whole action model and cloning\n\t// the action","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/runner/action.go#L184-L220","documentation":"Execution-time counterpart of the model validation: runAction switches on action.Runs.Using and falls into default when the value is not docker/node12/node16/node20/node24/composite. Because UnmarshalYAML already rejects bad values, hitting this usually means the Action struct was constructed without parsing metadata at all (zero-value Using), e.g. the Dockerfile-only fallback path where no action.yml exists.","triggerScenarios":"An action directory contains only a Dockerfile (no action.yml/action.yaml): readActionImpl returns an Action built from defaults with an empty Runs.Using, which then fails this switch. Also reachable when embedding act and supplying a hand-built model.Action with an unrecognized Using value.","commonSituations":"Dockerfile-only actions that GitHub supports implicitly but act requires metadata for; programmatic users bypassing YAML parsing; new runtime values added to the model but not to this switch in the runner.","solutions":["Add an action.yml to the action repo declaring `runs: { using: docker, image: Dockerfile }` so the Dockerfile path is explicit.","If embedding act, always construct model.Action via ReadAction (YAML) rather than struct literals.","Update act — mismatches between model constants and the runner switch are fixed in newer releases."],"exampleFix":"# add action.yml next to Dockerfile\nname: my-action\ndescription: runs container\nruns:\n  using: docker\n  image: Dockerfile","handlingStrategy":"validation","validationCode":"func hasValidUsing(a *model.Action) bool {\n    switch a.Runs.Using {\n    case model.ActionRunsUsingDocker, model.ActionRunsUsingNode12, model.ActionRunsUsingNode16,\n         model.ActionRunsUsingNode20, model.ActionRunsUsingNode24, model.ActionRunsUsingComposite:\n        return true\n    }\n    return false\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"The runs.using key must be one of\") {\n    // the action was loaded without real metadata; add action.yml next to the Dockerfile and re-run\n}","preventionTips":["Always ship an action.yml — even Dockerfile-only actions should declare using: docker.","When embedding act, build model.Action via ReadAction/ReadWorkflow rather than struct literals.","Keep model constants and runner switch in sync when forking or extending act."],"tags":["action","runs-using","runner","dockerfile"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}