An automated leaderboard system that tracks and ranks contributors based on their merged pull requests using an Elo rating system.
This system automatically calculates Elo ratings for each contributor based on multiple factors:
- Task Difficulty: Complexity of the work (bugs, features, architecture changes)
- Code Quality: Review approvals, changes requested, linked issues
- Timeliness: How quickly work is completed
- Collaboration: Review engagement and issue tracking
- Starting Rating: Everyone begins at 1200 Elo
- Gain/Loss: Complete challenging tasks to gain points
- K-Factor: New contributors have higher rating volatility (32), veterans are more stable (16)
- Expected vs Actual: Your rating vs. task difficulty determines point changes
| Task Type | Base Elo |
|---|---|
| Bug Fix | 1000 |
| Documentation | 1100 |
| Enhancement | 1200 |
| Technical Debt | 1250 |
| Feature | 1300 |
| Refactor | 1300 |
| Hotfix | 1400 |
| Critical Bug | 1500 |
| Architecture | 1500 |
Adjustments:
- +50-100 for large code changes (500+ lines)
- +25-50 for many files changed (10+ files)
- +30 for complex reviews (10+ review comments)
Your Elo gain is multiplied based on code quality:
- ✅ Clean Approval: +15% (no changes requested)
- ✅ Multiple Approvals: +10% (2+ reviewers)
- ✅ Linked Issues: +5% per issue
- ✅ Clean Commits: +5% (≤3 commits)
- ✅ Good Review Ratio: +5% (balanced discussion)
⚠️ Changes Requested: -10% per request⚠️ Too Many Commits: -5% (>10 commits, suggests messy work)
Multiplier Range: 0.5x to 1.5x
Completion speed affects your rating:
- 🚀 Under 24 hours: +10% bonus
- 📅 Under 3 days: +5% bonus
- ⏳ Over 1 week: -5% penalty
- 🏃 Under 2 hours: -10% (might be rushed)
| Rank | Title | Description |
|---|---|---|
| 1 | 👑 Grand Master | The top contributor |
| 2 | ⭐ Master | Elite performer |
| 3 | 💎 Diamond | Exceptional quality |
| 4 | 🥇 Gold | Consistent excellence |
| 5 | 🥈 Silver | Strong contributor |
| 6 | 🥉 Bronze | Solid work |
| 7+ | 📈 Rising Star | Growing contributor |
| All others | 🌱 Contributor | Part of the team |
# Create directory structure
mkdir -p .github/workflows
mkdir -p .github/scripts
# Copy files
cp elo-leaderboard.yml .github/workflows/
cp elo-calculator.js .github/scripts/
cp leaderboard.json ./git add .github/ leaderboard.json
git commit -m "Add Elo leaderboard system"
git pushThe system uses PR labels to determine difficulty. Add these labels:
bug- Bug fixesenhancement- Improvementsfeature- New featuresrefactor- Code refactoringdocumentation- Documentation updatescritical- Critical issueshotfix- Emergency fixestechnical-debt- Tech debt reductionarchitecture- Architectural changes
- Create a test PR with appropriate labels
- Get it reviewed
- Merge it
- Check the PR comments for Elo update
- View
leaderboard.mdfor the full rankings
- Label Your PRs: Add appropriate labels to help the system calculate difficulty
- Link Issues: Reference issue numbers (e.g., "Fixes #123") in your PR description
- Get Reviews: Request reviews from teammates
- Write Clean Code: Aim for clean commits and address review feedback
- Track Progress: Check
leaderboard.mdto see your ranking
Ensure Quality PRs Get Rewarded:
- Review PRs thoroughly
- Approve high-quality work
- Request changes when needed
- Add appropriate labels
Monitor the System:
- Check
leaderboard.jsonfor raw data - Review
leaderboard.mdfor human-readable rankings - Adjust difficulty ratings in
elo-calculator.jsif needed
Edit .github/scripts/elo-calculator.js:
const TASK_DIFFICULTY = {
'bug': 1000, // Change these values
'feature': 1300, // to match your team's needs
'critical': 1500,
// Add custom labels
'my-custom-label': 1350
};In elo-calculator.js, find calculateQualityMultiplier():
// Adjust these values
if (prData.approved_reviews > 0 && prData.changes_requested === 0) {
multiplier += 0.15; // Change bonus amount
}In elo-calculator.js, find getKFactor():
function getKFactor(contributionCount) {
if (contributionCount < 10) return 32; // Adjust thresholds
if (contributionCount < 50) return 24; // and K values
return 16;
}Check leaderboard.md - it's automatically updated with:
- Current rankings
- Individual stats
- Recent activity
leaderboard.json contains:
- All contributor ratings
- PR history
- Timestamps
- Metadata
View workflow runs in the "Actions" tab to see:
- Elo calculations
- Point changes
- Any errors
- Celebrate Progress: Share leaderboard updates in team meetings
- Encourage Collaboration: Focus on team wins, not just individual rankings
- Balance Competition: Keep it fun and friendly
- Recognize Different Strengths: Some excel at bugs, others at features
- Regular Check-ins: Review system effectiveness quarterly
- Don't Game the System: Focus on quality, not just quantity
- Help Others: Review PRs, mentor teammates
- Take On Challenges: Try harder tasks for bigger rewards
- Learn from Feedback: Use reviews to improve
- Stay Consistent: Regular contributions build expertise
- Check GitHub Actions tab for errors
- Verify workflow has write permissions
- Ensure
leaderboard.jsonexists in root - Check PR was actually merged (not just closed)
- Verify PR labels are correct
- Check if reviews were submitted before merge
- Review
.github/scripts/elo-calculator.jsfor logic errors - Check GitHub Actions logs for calculation details
- Verify workflow has issue comment permissions
- Check GitHub Actions logs for API errors
- Ensure bot user has repository access
Consider adding:
- Team-based Elo (department rankings)
- Monthly/quarterly resets for fresh starts
- Achievement badges (100 PRs, 1500 Elo, etc.)
- Seasonal competitions
- Integration with Slack/Discord for notifications
- Historical trend graphs
- Review quality scoring (helpful reviews earn points)
MIT License - Feel free to modify and adapt for your team!
Questions or issues?
- Check GitHub Actions logs first
- Review this README
- Open an issue in the repository
- Adjust settings in
elo-calculator.jsas needed
Remember: This system is designed to boost morale and recognize great work. Keep it fun, fair, and focused on team success! 🎉