| 53 | } |
| 54 | |
| 55 | async function fetchRepo(slug) { |
| 56 | const response = await fetch(`https://api.github.com/repos/${slug}`, { |
| 57 | headers: { |
| 58 | Accept: 'application/vnd.github+json', |
| 59 | 'User-Agent': 'awesome-langgraph-repo-checks', |
| 60 | ...(GITHUB_TOKEN ? { Authorization: `Bearer ${GITHUB_TOKEN}` } : {}), |
| 61 | }, |
| 62 | }); |
| 63 | |
| 64 | if (!response.ok) { |
| 65 | const body = await response.text(); |
| 66 | throw new Error(`GitHub API request failed for ${slug}: ${response.status} ${response.statusText} ${body}`); |
| 67 | } |
| 68 | |
| 69 | return response.json(); |
| 70 | } |
| 71 | |
| 72 | function classifyRepo(repo, cutoffDate, isCommunityRepo) { |
| 73 | const pushedAt = repo.pushed_at ? new Date(repo.pushed_at) : null; |