Generate comprehensive PR activity metrics, charts, and insights for your repository. Track team performance, identify bottlenecks, and improve your development workflow with data-driven insights.
- π Comprehensive Metrics: Total PRs, merge rates, time to merge, and more
- π₯ Top Contributors: Track who's contributing and their merge rates
- π PR Size Analysis: Distribution of PR sizes (XS, S, M, L, XL)
- π Activity Patterns: See which days are most active
- π ASCII Charts: Visual representations right in markdown
- π‘ Automated Insights: Get actionable recommendations
- β±οΈ Time Tracking: Average and median time to merge
Create .github/workflows/pr-metrics.yml:
name: PR Metrics Dashboard
on:
schedule:
- cron: '0 0 * * 0' # Weekly on Sunday
workflow_dispatch:
jobs:
metrics:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v4
- name: Generate metrics
uses: rkneela0912/pr-metrics-dashboard@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
days: 30
- name: Commit report
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add PR_METRICS.md
git commit -m "docs: update PR metrics" || exit 0
git pushThe action generates a comprehensive markdown report with:
- Overview metrics (total PRs, merge rate, avg time to merge)
- Top contributors ranking
- PR size distribution
- Activity by day of week
- ASCII charts for visualization
- Automated insights and recommendations
| Input | Description | Default | Required |
|---|---|---|---|
github_token |
GitHub token for API access | - | β Yes |
days |
Number of days to analyze | 30 |
No |
output_file |
Output file path | PR_METRICS.md |
No |
include_charts |
Include ASCII charts | true |
No |
| Output | Description |
|---|---|
total_prs |
Total number of PRs |
merged_prs |
Number of merged PRs |
avg_time_to_merge |
Average time to merge (hours) |
report_file |
Generated report file path |
on:
schedule:
- cron: '0 0 * * 0' # Every Sunday
jobs:
metrics:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- uses: actions/checkout@v4
- uses: rkneela0912/pr-metrics-dashboard@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
days: 7- uses: rkneela0912/pr-metrics-dashboard@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
days: 30
output_file: 'docs/metrics/monthly-report.md'- uses: rkneela0912/pr-metrics-dashboard@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
days: 90
output_file: 'reports/Q1-2025.md'- Total PRs (open, merged, closed)
- Merge rate percentage
- Average time to merge
- Median time to merge
- Top 10 contributors
- PR size distribution (XS/S/M/L/XL)
- Activity by day of week
The dashboard provides intelligent insights such as:
- β Fast merge times detected
β οΈ Slow review cycles identified- β High merge rate achievements
β οΈ Large PR warnings- π Weekend activity patterns
- Create workflow file in
.github/workflows/ - Configure schedule (weekly, monthly, etc.)
- Set permissions (contents: write, pull-requests: read)
- Add commit step to save the report
- Test manually using "Run workflow" button
- Run weekly for regular tracking
- Commit reports to track trends over time
- Share reports with the team
- Use insights to improve processes
- Adjust
daysparameter based on your sprint length
No PRs found?
- Check the
daysparameter covers a period with PR activity
Report not committed?
- Ensure
contents: writepermission is set - Check git config is set correctly in commit step
permissions:
contents: write # To commit the report
pull-requests: read # To read PR dataContributions welcome! Open an issue or submit a PR.
Star this repo if you find it helpful!
For issues: Open an issue
Made with β€οΈ to help teams improve their development workflow
Make your workflow more efficient with automation!