(page = 1)
| 295 | } |
| 296 | |
| 297 | async function fetchContributors(page = 1) { |
| 298 | // contributors that contribute to repos other than `vueuse/vueuse`, required for contributor avatar to work |
| 299 | const additional = ['egoist', 'Tahul', 'BobbieGoede'] |
| 300 | |
| 301 | const collaborators: string[] = [] |
| 302 | const data = await $fetch<{ login: string }[]>(`https://api.github.com/repos/vueuse/vueuse/contributors?per_page=100&page=${page}`, { |
| 303 | method: 'get', |
| 304 | headers: { |
| 305 | 'content-type': 'application/json', |
| 306 | }, |
| 307 | }) || [] |
| 308 | collaborators.push(...data.map(i => i.login)) |
| 309 | if (data.length === 100) |
| 310 | collaborators.push(...(await fetchContributors(page + 1))) |
| 311 | |
| 312 | return Array.from(new Set([ |
| 313 | ...collaborators.filter(collaborator => !['renovate[bot]', 'dependabot[bot]', 'renovate-bot'].includes(collaborator)), |
| 314 | ...additional, |
| 315 | ])) |
| 316 | } |
| 317 | |
| 318 | export async function updateContributors() { |
| 319 | const collaborators = await fetchContributors() |
no outgoing calls
no test coverage detected