( ctx context.Context)
| 117 | } |
| 118 | |
| 119 | func (org *Organization) GetInstalls( |
| 120 | ctx context.Context) (map[types.InstallID]types.Install, error) { |
| 121 | if len(org.Installations) > 0 { |
| 122 | return org.Installations, nil |
| 123 | } |
| 124 | |
| 125 | log.Logger.Debugf( |
| 126 | "Fetching app installs for %s", |
| 127 | *org.info.Login, |
| 128 | ) |
| 129 | |
| 130 | opt := &github.ListOptions{PerPage: org.paginationSize} |
| 131 | installs, err := utils.GetPaginatedResult( |
| 132 | ctx, |
| 133 | org.backoff, |
| 134 | opt, |
| 135 | func(opts *github.ListOptions) (*github.OrganizationInstallations, *github.Response, error) { |
| 136 | return org.client.Organizations.ListInstallations( |
| 137 | ctx, |
| 138 | *org.info.Login, |
| 139 | opt, |
| 140 | ) |
| 141 | }, |
| 142 | utils.InstallsAggregator, |
| 143 | ) |
| 144 | if err != nil { |
| 145 | log.Logger.Error(err) |
| 146 | } |
| 147 | |
| 148 | installMap := make(map[types.InstallID]types.Install, len(installs)) |
| 149 | for _, i := range installs { |
| 150 | installMap[types.InstallID(*i.ID)] = i |
| 151 | } |
| 152 | org.Installations = installMap |
| 153 | return installMap, err |
| 154 | } |
| 155 | |
| 156 | func (org *Organization) GetActionRunners( |
| 157 | ctx context.Context) (map[types.RunnerID]types.Runner, error) { |
no test coverage detected