Skip to content

Commit

Permalink
update deprecated github lib calls
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
  • Loading branch information
katexochen committed Apr 29, 2024
1 parent e1ab83b commit aafee91
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/cmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,12 @@ func (c *githubClient) DeleteWorkflowRuns(ctx context.Context, runs []*github.Wo
}

func (c *githubClient) GetUserRepositories(ctx context.Context) ([]*github.Repository, error) {
opt := &github.RepositoryListOptions{
Affiliation: "owner",
opt := &github.RepositoryListByUserOptions{
ListOptions: github.ListOptions{PerPage: 1000},
}
var allRepos []*github.Repository
for {
repos, resp, err := c.client.Repositories.List(ctx, "", opt)
repos, resp, err := c.client.Repositories.ListByUser(ctx, "", opt)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -136,7 +135,7 @@ func (c *githubClient) SyncFork(ctx context.Context, repo *github.Repository, br
}

func (c *githubClient) GetBranch(ctx context.Context, repo *github.Repository, branch string) (*github.Branch, error) {
result, resp, err := c.client.Repositories.GetBranch(ctx, repo.GetOwner().GetLogin(), repo.GetName(), branch, true)
result, resp, err := c.client.Repositories.GetBranch(ctx, repo.GetOwner().GetLogin(), repo.GetName(), branch, 10)
if err != nil {
return nil, fmt.Errorf("getting branch: %w", err)
}
Expand Down

0 comments on commit aafee91

Please sign in to comment.