Repository navigation
fix: search all comment pages and clarify fork token errors - #257
Merged
Merged
Conversation
Search every page of pull request comments before creating a new comment so an existing marker is found even on threads with more than 1,000 comments. This avoids posting a duplicate warning on every synchronize run. Return a typed API error and add a warning hint when the GitHub API responds with 403, explaining that the default token is read-only for pull requests from forks. Document trusted, write-enabled options in the README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves support and error handling for posting comments on pull requests, especially those originating from forks, and enhances test coverage and documentation. The most important changes are summarized below.
Error handling and messaging for fork pull requests:
APIErrortype andIsForbiddenhelper to detect GitHub API 403 errors, which typically occur when attempting to comment on pull requests from forks with a read-only token. The action now logs a clear warning and provides guidance on how to enable commenting (e.g., usingpull_request_targetor a write-capable token). [1] [2]pull_request_target.Comment handling improvements:
maxCommentPageslimit and updated the comment search logic to scan all pages, preventing duplicate comments when a pull request has many comments. [1] [2]Testing enhancements:
Codebase maintenance:
Documentation updates: