Skip to content

fix: first pr comment logic (2nd attempt) #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2025
Merged

Conversation

MantisClone
Copy link
Member

  1. Replaced the previous REST API endpoint with the GitHub Search API, which provides more accurate results for finding PRs by a specific author in a specific repository
  2. Used repo:${{ github.repository }} is:pr author:$PR_AUTHOR as the search query to find all PRs by this author to this specific repository
  3. Added proper URL encoding for the search query
  4. Extracted the total_count field from the search results to determine how many PRs this user has created
  5. Added more detailed logging to help with troubleshooting

The GitHub Search API provides a more reliable way to check if a user has submitted PRs to a repository before. It's less likely to be affected by any backend connections between different GitHub accounts.

If for some reason this still doesn't work properly, then yes, using a completely different email address for testing would be a good approach to ensure the accounts are completely separate in GitHub's system.

@MantisClone MantisClone merged commit 07b4743 into main Mar 22, 2025
1 check passed
@MantisClone MantisClone deleted the fix-first-pr-logic-2 branch March 22, 2025 05:49
@MantisClone MantisClone linked an issue Mar 22, 2025 that may be closed by this pull request
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.

Develop a reusable Github Actions workflow for posting comments on pull requests
1 participant