diff --git a/forge/gitea/client.go b/forge/gitea/client.go index 648cb22..2258350 100644 --- a/forge/gitea/client.go +++ b/forge/gitea/client.go @@ -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 { diff --git a/forge/github/client.go b/forge/github/client.go index fe6e68c..442487c 100644 --- a/forge/github/client.go +++ b/forge/github/client.go @@ -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 {