diff --git a/cmd/githubPublishRelease.go b/cmd/githubPublishRelease.go index 3f8c235e7..ca0ac421a 100644 --- a/cmd/githubPublishRelease.go +++ b/cmd/githubPublishRelease.go @@ -115,9 +115,19 @@ func getClosedIssuesText(ctx context.Context, publishedAt github.Timestamp, conf if len(config.Labels) > 0 { options.Labels = config.Labels } - ghIssues, _, err := ghIssueClient.ListByRepo(ctx, config.Owner, config.Repository, &options) - if err != nil { - log.Entry().WithError(err).Error("Failed to get GitHub issues.") + + var ghIssues []*github.Issue + for { + issues, resp, err := ghIssueClient.ListByRepo(ctx, config.Owner, config.Repository, &options) + if err != nil { + log.Entry().WithError(err).Error("failed to get GitHub issues") + } + + ghIssues = append(ghIssues, issues...) + if resp.NextPage == 0 { + break + } + options.Page = resp.NextPage } prTexts := []string{"**List of closed pull-requests since last release**"} diff --git a/cmd/githubPublishRelease_test.go b/cmd/githubPublishRelease_test.go index a647fbf15..857317009 100644 --- a/cmd/githubPublishRelease_test.go +++ b/cmd/githubPublishRelease_test.go @@ -84,6 +84,7 @@ func (g *ghRCMock) UploadReleaseAsset(ctx context.Context, owner string, repo st type ghICMock struct { issues []*github.Issue + response github.Response lastPublished time.Time owner string repo string @@ -95,7 +96,7 @@ func (g *ghICMock) ListByRepo(ctx context.Context, owner string, repo string, op g.repo = repo g.options = opt g.lastPublished = opt.Since - return g.issues, nil, nil + return g.issues, &g.response, nil } func TestRunGithubPublishRelease(t *testing.T) {