feat: Add weekly GitHub PR report automation system#44
Open
Justinohallo wants to merge 1 commit into
Open
Conversation
- Add date-fns dependency for date handling - Create GitHub API integration to fetch merged PRs - Implement report generation with categorization (feature/fix/docs/refactor/other) - Add API endpoints for report generation and retrieval - Create UI pages for viewing weekly reports - Configure Vercel cron job for automatic weekly generation - Add local testing script for manual report generation API Routes: - POST /api/weekly-report (authenticated, admin only) - GET /api/reports/latest (public) Pages: - /reports (listing page) - /reports/[slug] (individual report page) Files saved to /data/reports/ directory
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements a complete weekly GitHub PR report automation system that fetches merged PRs from the bitcoin-builder repository, generates structured JSON and Markdown reports, and provides API endpoints and UI pages for viewing reports.
Features
/data/reports/directoryPOST /api/weekly-report(authenticated, admin only) - Generate new reportGET /api/reports/latest(public) - Get latest report/reports- Listing page showing all available reports/reports/[slug]- Individual report page with detailed breakdownChanges
New Files
lib/github/fetchMergedPRs.ts- GitHub API integrationlib/reports/buildReport.ts- Report generation and categorization logiclib/reports/saveReport.ts- File system operations for reportsapp/api/weekly-report/route.ts- POST endpoint for report generationapp/api/reports/latest/route.ts- GET endpoint for latest reportapp/reports/page.tsx- Reports listing pageapp/reports/[slug]/page.tsx- Individual report pagescripts/run-weekly-report-local.sh- Local testing scriptvercel.json- Vercel cron job configurationModified Files
package.json- Addeddate-fnsdependencylib/types.ts- Added report type definitionsSetup Required
GITHUB_TOKENenvironment variable (GitHub personal access token with repo read permissions)POST /api/weekly-report(requires admin authentication)Testing
scripts/run-weekly-report-local.shDocumentation
Reports are saved in the format:
weekly-YYYY-MM-DD.json- Structured JSON dataweekly-YYYY-MM-DD.md- Formatted Markdown report