ListByOrg lists the repositories for an organization. GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories meta:operation GET /orgs/{org}/repos
(ctx context.Context, org string, opts *RepositoryListByOrgOptions)
| 445 | // |
| 446 | //meta:operation GET /orgs/{org}/repos |
| 447 | func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opts *RepositoryListByOrgOptions) ([]*Repository, *Response, error) { |
| 448 | u := fmt.Sprintf("orgs/%v/repos", org) |
| 449 | u, err := addOptions(u, opts) |
| 450 | if err != nil { |
| 451 | return nil, nil, err |
| 452 | } |
| 453 | |
| 454 | req, err := s.client.NewRequest(ctx, "GET", u, nil) |
| 455 | if err != nil { |
| 456 | return nil, nil, err |
| 457 | } |
| 458 | |
| 459 | acceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview} |
| 460 | req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) |
| 461 | |
| 462 | var repos []*Repository |
| 463 | resp, err := s.client.Do(req, &repos) |
| 464 | if err != nil { |
| 465 | return nil, resp, err |
| 466 | } |
| 467 | |
| 468 | return repos, resp, nil |
| 469 | } |
| 470 | |
| 471 | // RepositoryListAllOptions specifies the optional parameters to the |
| 472 | // RepositoriesService.ListAll method. |
no test coverage detected