Skip to content

chore(pr-review): trigger automated review workflow on issue comments#3918

Merged
rickeylev merged 3 commits into
bazel-contrib:mainfrom
rickeylev:fix-pr-comment-trigger
Jul 11, 2026
Merged

chore(pr-review): trigger automated review workflow on issue comments#3918
rickeylev merged 3 commits into
bazel-contrib:mainfrom
rickeylev:fix-pr-comment-trigger

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

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_comment to issue_comment, ensure the event is on a pull request by checking github.event.issue.pull_request != null, and check out refs/pull/$NUMBER/head so the PR branch is retrieved during comment events.

  • Also checks \r\n/review when parsing comment body for multiline /review commands.

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.
@rickeylev rickeylev requested a review from aignas as a code owner July 11, 2026 00:47
@gemini-code-assist

Copy link
Copy Markdown
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`.
@rickeylev rickeylev merged commit 966329b into bazel-contrib:main Jul 11, 2026
2 of 4 checks passed
@rickeylev rickeylev deleted the fix-pr-comment-trigger branch July 11, 2026 02:40
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.

1 participant