fix(forge): empty label lists every open issue (archie #1770)
publish / publish (push) Successful in 1m21s
publish / publish (push) Successful in 1m21s
This commit is contained in:
2 files changed
+7
-2
No files matched your search
@@ -113,12 +113,15 @@ func (c *GiteaClient) AssignedIssues(ctx context.Context, owner, repo, assignee
|
||||
}
|
||||
|
||||
// IssuesWithLabel returns open issues matching the given label, excluding PRs.
|
||||
// An empty label matches every open issue.
|
||||
func (c *GiteaClient) IssuesWithLabel(ctx context.Context, owner, repo, label string) ([]forge.Issue, error) {
|
||||
opts := gitea.ListIssueOption{
|
||||
ListOptions: gitea.ListOptions{PageSize: 50},
|
||||
State: gitea.StateOpen,
|
||||
Type: gitea.IssueTypeIssue,
|
||||
Labels: []string{label},
|
||||
}
|
||||
if label != "" {
|
||||
opts.Labels = []string{label}
|
||||
}
|
||||
var out []forge.Issue
|
||||
for {
|
||||
|
||||
@@ -144,9 +144,11 @@ func (c *GitHubClient) IssuesWithLabel(ctx context.Context, owner, repo, label s
|
||||
var out []forge.Issue
|
||||
opts := &github.IssueListByRepoOptions{
|
||||
State: "open",
|
||||
Labels: []string{label},
|
||||
ListOptions: github.ListOptions{PerPage: 50},
|
||||
}
|
||||
if label != "" {
|
||||
opts.Labels = []string{label}
|
||||
}
|
||||
for {
|
||||
issues, resp, err := c.gh.Issues.ListByRepo(ctx, owner, repo, opts)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user