Skip to content

Conversation

@anujc25
Copy link
Contributor

@anujc25 anujc25 commented Jan 7, 2026

Problem

The contributions-for-user.sh script was incorrectly reporting pull requests as issues, leading to:

  • PRs appearing in the "Issues" section instead of the "PRs Commented on/Reviewed" section
  • Duplicate reporting where the same contribution could appear in multiple sections
  • Incomplete PR review tracking due to reliance solely on GitHub Events API (which only returns the last 90 days and 300 events)

Before this change: 0 PRs tracked, 11 items in issues (most were actually PRs) (Reference: https://gist.github.com/anujc25/ddbf3c6c686e0fa1028c72b3584c1ede)

After this change: 26 PRs properly tracked, 1 actual issue (Reference: https://gist.github.com/anujc25/f2e7ab6b2e1129769ce9f1d8003324b3)

Solution

  1. Use GitHub Search API to find PR reviews and comments (provides complete history, not just last 90 days)

    • search/issues?q=repo:${repo}+type:pr+reviewed-by:${user} - finds official reviews
    • search/issues?q=repo:${repo}+type:pr+commenter:${user} - finds PR comment participation
  2. Filter PRs from issue queries using select(.pull_request == null) to prevent PRs from appearing in the issues section

  3. Keep Events API as fallback for recent activity

- Add GitHub Search API support for finding PR reviews
- Track PR review comments using commenter search
- Filter out pull requests from issue queries
- Prevent duplicate reporting of PRs as issues
- Improve accuracy of contribution detection
@beyhan beyhan added the toc label Jan 8, 2026
@beyhan beyhan requested review from a team, Gerg, beyhan, cweibel, rkoster and stephanme and removed request for a team January 8, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants