Add gm tool for pulling all issues from a repo and filtering client-side-ish to only ones that had a given label at any point (#39524)

This absolutely slams GitHub rate limits, but one API request per page
of issues plus one API request per issue is the only sure way to get
this data, so it is what it is. May need to add a "pick up where you
left off" feature but this is at least a starting point.
This commit is contained in:
Ian Littman
2026-02-23 15:18:32 -06:00
committed by GitHub
parent 4258e62fa3
commit 04a9f1a2df
4 changed files with 308 additions and 0 deletions
+12
View File
@@ -1,5 +1,7 @@
package ghapi
import "strings"
type Author struct {
Login string `json:"login"`
IsBot bool `json:"is_bot"`
@@ -38,6 +40,16 @@ type Issue struct {
Status string `json:"status,omitempty"` // Custom field for status
}
// HasLabel checks if an issue currently has the specified label (case-insensitive)
func (issue Issue) HasLabel(labelName string) bool {
for _, label := range issue.Labels {
if strings.EqualFold(label.Name, labelName) {
return true
}
}
return false
}
type Sprint struct {
Duration int `json:"duration"`
IterationId string `json:"iterationId"`