{"record":{"id":"75016904417c5877","repo":"gastownhall/beads","slug":"no-runs-found-for-workflow-s","errorCode":null,"errorMessage":"no runs found for workflow '%s'","messagePattern":"no runs found for workflow '(.+?)'","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/gate.go","lineNumber":1001,"sourceCode":"func discoverRunIDByWorkflowNameInRepo(workflowHint, repo string) (string, error) {\n\treturn discoverRunIDByWorkflowNameInRepoWithRunner(workflowHint, repo, runGHCommand)\n}\n\n// discoverRunIDByWorkflowNameInRepoWithRunner is the runner-injectable form of\n// discoverRunIDByWorkflowNameInRepo. checkGHRunWithRunner's cross-repo branch\n// must call this (not discoverRunIDByWorkflowNameInRepo directly) so the same\n// injected ghCommandRunner seam used everywhere else in the gh:run/gh:pr\n// checks also covers cross-repo discovery, keeping that path unit-testable\n// without a live `gh` CLI (standards note on the SF1 review).\nfunc discoverRunIDByWorkflowNameInRepoWithRunner(workflowHint, repo string, runGH ghCommandRunner) (string, error) {\n\t// Query GitHub directly for this workflow (efficient, avoids limit issues)\n\truns, err := queryGitHubRunsForWorkflowInRepoWithRunner(workflowHint, 5, repo, runGH)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to query workflow runs: %w\", err)\n\t}\n\n\tif len(runs) == 0 {\n\t\treturn \"\", fmt.Errorf(\"no runs found for workflow '%s'\", workflowHint)\n\t}\n\n\t// Take the most recent run (gh returns newest-first)\n\t// This is deterministic: \"most recent\" is a total ordering by creation time\n\treturn fmt.Sprintf(\"%d\", runs[0].DatabaseID), nil\n}\n\n// checkGHRun checks a GitHub Actions workflow run gate.\n// When persistAwaitID is nil, workflow-name discovery stays in-memory only.\nfunc checkGHRun(gate *types.Issue, persistAwaitID func(gateID, runID string) error) (resolved, escalated bool, reason string, err error) {\n\treturn checkGHRunWithRunner(gate, persistAwaitID, runGHCommand)\n}\n\nfunc checkGHRunWithRunner(gate *types.Issue, persistAwaitID func(gateID, runID string) error, runGH ghCommandRunner) (resolved, escalated bool, reason string, err error) {\n\tif gate.AwaitID == \"\" {\n\t\treturn false, false, \"no run ID specified - set await_id or use workflow name hint\", nil\n\t}\n","sourceCodeStart":983,"sourceCodeEnd":1019,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/gate.go#L983-L1019","documentation":"Raised when `gh run list` succeeds but returns zero runs for the given workflow name hint (cmd/bd/gate.go:1001). The workflow name parsed fine but GitHub has no matching runs, so no run ID can be discovered.","triggerScenarios":"A gh:run gate uses a non-numeric await_id workflow hint and the API query returns an empty array — the workflow exists in the repo but has never run, or the name doesn't match any executed workflow.","commonSituations":"Typo in the workflow name hint, workflow defined only on another branch (never run on default branch), workflow file recently added and not yet triggered, querying a fork/cross-repo with no runs.","solutions":["Trigger the workflow once (`gh workflow run <name>` or push) so a run exists","Check the hint matches the workflow's name/filename: `gh workflow list --repo <owner/repo>`","Verify you're querying the intended repo (cross-repo metadata may point elsewhere)","Replace the hint with a concrete numeric run ID via `gh run list --workflow=<name>`"],"exampleFix":"// before\nawait_id: \"deploy.yml\"  // never triggered\n// after\ngh workflow run deploy.yml   # or set await_id to an existing numeric run ID\nawait_id: \"1234567890\"","handlingStrategy":"validation","validationCode":"out, err := exec.Command(\"gh\", \"run\", \"list\", \"--workflow\", hint, \"--repo\", repo, \"--limit\", \"1\").Output()\nif err != nil || len(strings.Fields(string(out))) == 0 {\n    // hint has no runs — trigger the workflow or use a numeric run ID\n}","typeGuard":null,"tryCatchPattern":"if resolved, esc, reason, err := checkGHRun(gate); reason != \"\" && strings.Contains(reason, \"no runs found\") {\n    // not a hard error: trigger the workflow or fall back to a numeric await_id\n}","preventionTips":["Verify with `gh workflow list` that the hint matches a real workflow","Trigger the workflow at least once before gating on it","Prefer numeric run IDs for gates on rarely-run workflows"],"tags":["github-actions","gh-cli","workflow-discovery"],"backgroundTag":"no-workflow-runs-found","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}