MCPcopy Create free account
hub / github.com/github/gh-aw / isClosedByBot

Function isClosedByBot

pkg/cli/outcome_eval_issue.go:102–117  ·  view source on GitHub ↗

isClosedByBot checks the issue timeline to determine if the close event was performed by a bot.

(issueNumber int, repo string)

Source from the content-addressed store, hash-verified

100
101// isClosedByBot checks the issue timeline to determine if the close event was performed by a bot.
102func isClosedByBot(issueNumber int, repo string) bool {
103 events, err := ghAPIGetArray(fmt.Sprintf("issues/%d/events", issueNumber), repo)
104 if err != nil {
105 return false
106 }
107 // Walk backward to find the most recent close event
108 for i := range slices.Backward(events) {
109 event, _ := events[i]["event"].(string)
110 if event == "closed" {
111 actor, _ := events[i]["actor"].(map[string]any)
112 login, _ := actor["login"].(string)
113 return isBotUser(login)
114 }
115 }
116 return false
117}

Callers 1

evalCreateIssueFunction · 0.85

Calls 2

ghAPIGetArrayFunction · 0.85
isBotUserFunction · 0.85

Tested by

no test coverage detected