()
| 304 | } |
| 305 | |
| 306 | async function main() { |
| 307 | const token = process.env.GITHUB_TOKEN; |
| 308 | if (!token) { |
| 309 | log.warn('GITHUB_TOKEN not provided - using unauthenticated requests'); |
| 310 | } |
| 311 | |
| 312 | const dateRange = getLastMonthDateRange(); |
| 313 | log.info(`Collecting GitHub contribution statistics for ${dateRange.from} to ${dateRange.to}`); |
| 314 | |
| 315 | // Get merged pull requests using GitHub search API |
| 316 | log.info('Fetching merged pull requests using GitHub search API...'); |
| 317 | const allPullRequests = await getMergedPullRequestsFromSearch(dateRange, token); |
| 318 | log.info(`Found ${allPullRequests.length} merged pull requests across all repositories`); |
| 319 | |
| 320 | const generatedAt = new Date().toISOString(); |
| 321 | |
| 322 | const sortedPullRequests = sortPullRequests(allPullRequests); |
| 323 | |
| 324 | // Output Slack-formatted message to stdout |
| 325 | const slackMessage = formatSlackMessage(sortedPullRequests, dateRange.from, dateRange.to, generatedAt); |
| 326 | |
| 327 | // eslint-disable-next-line no-console |
| 328 | console.log(JSON.stringify(slackMessage, null, 2)); |
| 329 | log.info('All done!'); |
| 330 | } |
| 331 | |
| 332 | await main(); |
| 333 |
no test coverage detected