From 58a8c58f492f77abdd6c6e35521ff93f21729b26 Mon Sep 17 00:00:00 2001 From: Ivana Huckova Date: Tue, 18 Jun 2024 14:19:41 +0200 Subject: [PATCH] Workflows: Fix max per page limit to 100 --- pkg/github/workflows.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/github/workflows.go b/pkg/github/workflows.go index 1a3e8db5..1e56002c 100644 --- a/pkg/github/workflows.go +++ b/pkg/github/workflows.go @@ -56,8 +56,9 @@ func GetWorkflows(ctx context.Context, client models.Client, opts models.ListWor } // Fetch this many workflows per page because this API endpoint does not allow filtering by time. - // It's unlikely a repository will have more workflows than this. - data, _, err := client.ListWorkflows(ctx, opts.Owner, opts.Repository, &github.ListOptions{Page: 0, PerPage: 1000}) + // 100 is the maximum number of workflows that can be retrieved per request as specified in the GitHub API documentation. + // Also, it's unlikely a repository will have more workflows than this. + data, _, err := client.ListWorkflows(ctx, opts.Owner, opts.Repository, &github.ListOptions{Page: 1, PerPage: 100}) if err != nil { return nil, fmt.Errorf("listing workflows: opts=%+v %w", opts, err) }