(apiClient *api.Client, host string, variable *Variable)
| 77 | } |
| 78 | |
| 79 | func PopulateSelectedRepositoryInformation(apiClient *api.Client, host string, variable *Variable) error { |
| 80 | if variable.SelectedReposURL == "" { |
| 81 | return nil |
| 82 | } |
| 83 | |
| 84 | response := struct { |
| 85 | TotalCount int `json:"total_count"` |
| 86 | }{} |
| 87 | if err := apiClient.REST(host, "GET", variable.SelectedReposURL, nil, &response); err != nil { |
| 88 | return fmt.Errorf("failed determining selected repositories for %s: %w", variable.Name, err) |
| 89 | } |
| 90 | variable.NumSelectedRepos = response.TotalCount |
| 91 | return nil |
| 92 | } |
no test coverage detected