()
| 78 | } |
| 79 | |
| 80 | async function listInstallations() { |
| 81 | // The shared dev App has 100+ installations; the API defaults to 30 per page, |
| 82 | // so without pagination YOUR account can fall beyond page 1 and look "not installed". |
| 83 | const all = []; |
| 84 | for (let page = 1; ; page += 1) { |
| 85 | const res = await gh(`/app/installations?per_page=100&page=${page}`); |
| 86 | if (!res.ok) throw new Error(`GET /app/installations -> ${res.status}`); |
| 87 | const batch = await res.json(); |
| 88 | if (!Array.isArray(batch) || batch.length === 0) break; |
| 89 | all.push(...batch); |
| 90 | if (batch.length < 100) break; |
| 91 | } |
| 92 | return all; |
| 93 | } |
| 94 | async function pickInstallation() { |
| 95 | const list = await listInstallations(); |
| 96 | if (!list.length) throw new Error('App has no installations — install the dev GitHub App on your account first'); |
no test coverage detected