From 2b61ca38382fca2ea634cde8db7d72548db17605 Mon Sep 17 00:00:00 2001 From: Alin Balutoiu Date: Tue, 26 Mar 2024 14:44:27 +0000 Subject: [PATCH 1/2] Fix pagination for Copilot Seats --- github/copilot.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/github/copilot.go b/github/copilot.go index 51c938c9748..50e05253ce5 100644 --- a/github/copilot.go +++ b/github/copilot.go @@ -161,8 +161,12 @@ func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*Co //meta:operation GET /orgs/{org}/copilot/billing/seats func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { u := fmt.Sprintf("orgs/%v/copilot/billing/seats", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } - req, err := s.client.NewRequest("GET", u, opts) + req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err } From 8c842e528fd45446454f17ea8c5a80cf0dd2b3dd Mon Sep 17 00:00:00 2001 From: Alin Balutoiu Date: Tue, 26 Mar 2024 18:57:57 +0000 Subject: [PATCH 2/2] Fix copilot test --- github/copilot_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/github/copilot_test.go b/github/copilot_test.go index c65fda0f217..bc295af3a61 100644 --- a/github/copilot_test.go +++ b/github/copilot_test.go @@ -584,8 +584,9 @@ func TestCopilotService_ListCopilotSeats(t *testing.T) { const methodName = "ListCopilotSeats" + opts := &ListOptions{Page: 2} testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", nil) + _, _, err = client.Copilot.ListCopilotSeats(ctx, "\n", opts) return err })