fix(gate): handle workflow name hints in gh:run gate discovery (bd-m8ew)
When a formula specifies a gate with id="release.yml", the AwaitID now properly functions as a workflow name hint: - gate discover: finds gates where AwaitID is empty OR non-numeric - gate discover: filters matching runs by workflow name when hint present - gate check: gracefully handles non-numeric AwaitID with clear message Added isNumericRunID/isNumericID helpers and tests for the new behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Executed-By: beads/crew/dave Rig: beads Role: crew
This commit is contained in:
@@ -638,10 +638,29 @@ type ghPRStatus struct {
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
// isNumericID returns true if the string is a valid numeric ID
|
||||
func isNumericID(s string) bool {
|
||||
if s == "" {
|
||||
return false
|
||||
}
|
||||
for _, c := range s {
|
||||
if c < '0' || c > '9' {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// checkGHRun checks a GitHub Actions workflow run gate
|
||||
func checkGHRun(gate *types.Issue) (resolved, escalated bool, reason string, err error) {
|
||||
if gate.AwaitID == "" {
|
||||
return false, false, "no run ID specified", nil
|
||||
return false, false, "no run ID specified - run 'bd gate discover' first", nil
|
||||
}
|
||||
|
||||
// Check if AwaitID is a numeric run ID or a workflow name hint
|
||||
if !isNumericID(gate.AwaitID) {
|
||||
// Non-numeric AwaitID is a workflow name hint, needs discovery
|
||||
return false, false, fmt.Sprintf("awaiting discovery (workflow hint: %s) - run 'bd gate discover'", gate.AwaitID), nil
|
||||
}
|
||||
|
||||
// Run: gh run view <id> --json status,conclusion,name
|
||||
|
||||
Reference in New Issue
Block a user