Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
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.
Issue for this PR
Closes #50247
Type of change
What does this PR do?
pull_request_reviewwas described as a supported event, but it was not actually handled. It was missing fromUSER_EVENTS, so it fell through to the generic "Review this pull request" prompt, and the instruction was read frompayload.comment.body— a field a review payload does not have. A review whose body says/octherefore did nothing.This adds
pull_request_review(types: [submitted]) to the event routing, to the generated workflow'son:/if:blocks, and reads the instruction fromreview.bodyfor review events.Review bodies can be
nullwhen a review is submitted without text, so the newresolveTriggerBodyhelper keeps two cases apart:undefinedmeans the event has no body source at all (malformed payload worth failing on), while""means an empty body, which is reported as a missing mention. The helper is a pure function next toextractResponseText, exported throughgithub.tslike the other shared helpers.github/README.mdand the docs event table are updated to match the workflowopencode github installnow generates.How did you verify your code works?
bun test test/cli/github-action.test.ts→ 23 pass / 0 fail, including 6 newresolveTriggerBodycases (comment body for comment events, review body for reviews, a review never readingcomment.body, a comment never readingreview.body,body: null→"", no body source →undefined)tsgo --noEmitis clean@octokit/webhooks-types: everyPullRequestReviewEventvariant typesreview.bodyasstring | null, andSimplePullRequestcarriesnumber, so the PR-context path resolves correctlyScreenshots / recordings
N/A — no UI change.
Checklist