{"record":{"id":"dab16729e3803ba0","repo":"nektos/act","slug":"could-not-find-any-stages-to-run-view-the-valid-j","errorCode":null,"errorMessage":"Could not find any stages to run. View the valid jobs with `act --list`. Use `act --help` to find how to filter by Job ID/Workflow/Event Name","messagePattern":"Could not find any stages to run\\. View the valid jobs with `act --list`\\. Use `act --help` to find how to filter by Job ID/Workflow/Event Name","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/root.go","lineNumber":560,"sourceCode":"\t\t\t// this way user dont have to specify the event.\n\t\t\tlog.Debugf(\"Using first detected workflow event: %s\", events[0])\n\t\t\teventName = events[0]\n\t\t} else {\n\t\t\tlog.Debugf(\"Using default workflow event: push\")\n\t\t\teventName = \"push\"\n\t\t}\n\n\t\t// build the plan for this run\n\t\tif jobID != \"\" {\n\t\t\tlog.Debugf(\"Planning job: %s\", jobID)\n\t\t\tplan, plannerErr = planner.PlanJob(jobID)\n\t\t} else {\n\t\t\tlog.Debugf(\"Planning jobs for event: %s\", eventName)\n\t\t\tplan, plannerErr = planner.PlanEvent(eventName)\n\t\t}\n\t\tif plan != nil {\n\t\t\tif len(plan.Stages) == 0 {\n\t\t\t\tplannerErr = fmt.Errorf(\"Could not find any stages to run. View the valid jobs with `act --list`. Use `act --help` to find how to filter by Job ID/Workflow/Event Name\")\n\t\t\t}\n\t\t}\n\t\tif plan == nil && plannerErr != nil {\n\t\t\treturn plannerErr\n\t\t}\n\n\t\t// check to see if the main branch was defined\n\t\tdefaultbranch, err := cmd.Flags().GetString(\"defaultbranch\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Check if platforms flag is set, if not, run default image survey\n\t\tif len(input.platforms) == 0 {\n\t\t\tcfgFound := false\n\t\t\tcfgLocations := configLocations()\n\t\t\tfor _, v := range cfgLocations {\n\t\t\t\t_, err := os.Stat(v)","sourceCodeStart":542,"sourceCodeEnd":578,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/cmd/root.go#L542-L578","documentation":"After planning (PlanJob for a -j filter or PlanEvent for the detected/specified event), act checks that the resulting Plan has at least one stage. An empty plan means the workflows loaded fine but the filter matched nothing: no job with that ID for the chosen event, or the event itself triggers no workflow. The error text points you to 'act --list' and '--help' for discovering valid IDs and filters.","triggerScenarios":"Running 'act -j <JobID>' where the ID is misspelled or the job's 'if:'/'needs:' excludes it for the event; running act with an event name (via -e/--event) that no workflow's 'on:' includes; workflows whose triggers (e.g. schedule, workflow_run) never match the default push event act simulates.","commonSituations":"Default push-event simulation vs workflows that only trigger on PR/schedule; renamed jobs after refactors; reusable-workflow-called jobs not visible to the planner; matrix jobs referenced by raw ID; wrong working directory so no .github/workflows files are found and zero jobs exist.","solutions":["Run 'act --list' in the repo root to see valid job IDs and their workflows, then rerun with the exact ID.","Select the right event: 'act pull_request -j <id>' or pass an event file with '-e event.json' matching the workflow's 'on:' triggers.","Check the job's 'if:' condition and 'needs:' chain — dependent or conditionally-skipped jobs may be excluded from the plan.","Confirm you are in the repository root containing .github/workflows/."],"exampleFix":"# before\nact -j buld        # typo, plan has no stages\n\n# after\nact --list         # discover the real ID: build\nact -j build","handlingStrategy":"validation","validationCode":"// Confirm a job exists for the event before executing\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/nektos/act/pkg/model\"\n)\n\nfunc planOrExplain(workflowDir, event, jobID string) (*model.Plan, error) {\n\tplanner, err := model.NewWorkflowPlanner(workflowDir, true)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar plan *model.Plan\n\tif jobID != \"\" {\n\t\tplan, err = planner.PlanJob(jobID)\n\t} else {\n\t\tplan, err = planner.PlanEvent(event)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif plan == nil || len(plan.Stages) == 0 {\n\t\treturn nil, fmt.Errorf(\"no jobs match event %q / job %q; run 'act --list' to see valid IDs\", event, jobID)\n\t}\n\treturn plan, nil\n}","typeGuard":null,"tryCatchPattern":"if err := runExecute(cmd, args); err != nil {\n    if strings.Contains(err.Error(), \"Could not find any stages to run\") {\n        // discover valid jobs and retry with the first matching one\n        return retryWithDiscoveredJobID()\n    }\n    return err\n}","preventionTips":["Run 'act --list' before 'act -j <id>' to confirm the exact job ID.","Pass the right event ('act pull_request') when workflows only trigger on non-push events.","Run act from the repo root that contains .github/workflows/."],"tags":["cli","planner","workflow-filter","configuration"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}