Skip to content

Filter PRs by user in isFirstPullRequest#402

Open
michen00 wants to merge 2 commits intoactions:mainfrom
michen00:fix-first-interaction-369
Open

Filter PRs by user in isFirstPullRequest#402
michen00 wants to merge 2 commits intoactions:mainfrom
michen00:fix-first-interaction-369

Conversation

@michen00
Copy link

@michen00 michen00 commented Jan 24, 2026

Summary

  • Fixed isFirstPullRequest() to filter PRs by the current user's login
  • Changed logic to only check the relevant contribution type:
    • For issue events: only check isFirstIssue()
    • For PR events: only check isFirstPullRequest()
  • Previously, the OR logic meant repos with issues disabled would mark everyone as new contributors (since isFirstIssue returns true when no issues exist)

Test plan

  • Added test case "Ignores pull requests from other users"
  • Split "Skips...not first contribution" test into separate PR and issue tests
  • All 18 tests pass
  • Lint passes
  • Bundle updated

Closes #369

🤖 Generated with Claude Code

The isFirstPullRequest function was checking ALL PRs in the repo instead
of only the current user's PRs. This caused everyone to be identified as
a new contributor in repos with issues disabled (since isFirstIssue
returns true when no issues exist).

Now isFirstPullRequest filters PRs by user login, matching the behavior
of isFirstIssue.

Closes actions#369

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@michen00 michen00 requested a review from a team as a code owner January 24, 2026 18:58
@michen00 michen00 marked this pull request as draft January 24, 2026 19:00
@michen00 michen00 marked this pull request as ready for review January 24, 2026 19:03
@michen00 michen00 changed the title Fix: Filter PRs by user in isFirstPullRequest Filter PRs by user in isFirstPullRequest Jan 24, 2026
@michen00 michen00 marked this pull request as draft January 24, 2026 19:09
For issue events, only check isFirstIssue().
For PR events, only check isFirstPullRequest().

This fixes the case where repos with issues disabled would mark
everyone as a new contributor (since isFirstIssue returns true
when no issues exist).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@michen00 michen00 marked this pull request as ready for review January 24, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Every contributor identified as new contributor in repo without issues

1 participant