chore(pr-review): trigger automated review workflow on issue comments#3918
Merged
Conversation
The automated PR review workflow needs to trigger when maintainers leave `/review` conversation comments on PRs instead of requiring PR diff comments. Change event trigger to `issue_comment`, check that the issue is a PR, and check out `refs/pull/$NUMBER/head` so PR code is retrieved for conversation comments.
Contributor
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
`uv pip install` fails when run outside an active virtual environment or without `--system`. Run `uv venv --python 3.13` before running `uv pip install` so dependencies are installed into a dedicated `.venv` directory discovered by `uv run`.
During an `issue_comment` event on a pull request, `github.event.pull_request` is null and the PR number is stored in `github.event.issue.number`. Add an inline comment above `ref:` in `automated_pr_review.yaml` explaining that `github.event.issue.number` holds the pull request number when checking out `refs/pull/$NUMBER/head`.
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.
Currently, the automated PR review workflow requires a diff review comment (
pull_request_review_comment) to trigger on-demand reviews via/review. This prevents maintainers from triggering reviews from regular conversation comments on pull requests.To fix, change the event trigger from
pull_request_review_commenttoissue_comment, ensure the event is on a pull request by checkinggithub.event.issue.pull_request != null, and check outrefs/pull/$NUMBER/headso the PR branch is retrieved during comment events.\r\n/reviewwhen parsing comment body for multiline/reviewcommands.