(owner: string, repo: string, octokit: Octokit)
| 219 | } |
| 220 | |
| 221 | export const getRepoCollaborators = async (owner: string, repo: string, octokit: Octokit) => { |
| 222 | try { |
| 223 | const fetchFn = () => octokit.paginate(octokit.repos.listCollaborators, { |
| 224 | owner, |
| 225 | repo, |
| 226 | per_page: 100, |
| 227 | }); |
| 228 | |
| 229 | const collaborators = await fetchWithRetry(fetchFn, `repo ${owner}/${repo}`, logger); |
| 230 | return collaborators; |
| 231 | } catch (error) { |
| 232 | Sentry.captureException(error); |
| 233 | logger.error(`Failed to fetch collaborators for repo ${owner}/${repo}.`, error); |
| 234 | throw error; |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | /** |
| 239 | * Lists repositories that the authenticated user has explicit permission (:read, :write, or :admin) to access. |
no test coverage detected