INNER CODE UNIT · Go
getIssues
anjia0532/gcr.io_mirror · main.go:342
func getIssues(cli *github.Client, ctx context.Context, config *Config) ([]*github.Issue, error) {
issues, _, err := cli.Issues.ListByRepo(ctx, config.GhUser, config.Repo, &github.IssueListByRepoOptions{
//State: "closed",
State: "open",
Labels: []string{"porter"},
Sort: "created",
Direction: "desc",
// 防止被滥用,每次最多只能拉20条,虽然可以递归,但是没必要。
//ListOptions: github.ListOptions{Page: 1, PerPage: 20},
// 考虑了下,每次还是只允许转一个吧
ListOptions: github.ListOptions{Page: 1, PerPage: 1},
})
return issues, err
}