( ctx context.Context)
| 72 | } |
| 73 | |
| 74 | func (repo *Repository) GetWorkflows( |
| 75 | ctx context.Context) (map[types.WorkflowID]types.Workflow, error) { |
| 76 | if len(repo.Workflows) > 0 { |
| 77 | return repo.Workflows, nil |
| 78 | } |
| 79 | |
| 80 | opt := &github.ListOptions{PerPage: repo.paginationSize} |
| 81 | workflows, err := utils.GetPaginatedResult( |
| 82 | ctx, |
| 83 | repo.backoff, |
| 84 | opt, |
| 85 | func(opts *github.ListOptions) (*github.Workflows, *github.Response, error) { |
| 86 | return repo.client.Actions.ListWorkflows( |
| 87 | ctx, |
| 88 | *repo.info.Organization.Login, |
| 89 | *repo.info.Name, |
| 90 | opt, |
| 91 | ) |
| 92 | }, |
| 93 | utils.WorkflowsAggregator, |
| 94 | ) |
| 95 | |
| 96 | wfMap := make(map[types.WorkflowID]types.Workflow, len(workflows)) |
| 97 | for _, w := range workflows { |
| 98 | wfMap[types.WorkflowID(*w.ID)] = w |
| 99 | } |
| 100 | repo.Workflows = wfMap |
| 101 | return wfMap, err |
| 102 | } |
| 103 | |
| 104 | // GetCollaborators returns the outside collaborators for a given org. Upon first call, |
| 105 | // it lazily updates the Organization with the user information |
nothing calls this directly
no test coverage detected