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:
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user