-
Notifications
You must be signed in to change notification settings - Fork 207
Description
TL;DR
The PR review workflow only handles pull_request and workflow_dispatch events, but not pull_request_review_comment and pull_request_review events. This causes PR reviews to fail when triggered by review comments or review submissions. Need to extend the event handling logic to include these missing event types.
Problem Description
The auto-generated workflows provided by run-gemini-cli do not properly handle pull request review events (pull_request_review_comment and pull_request_review), causing PR reviews to fail due to missing pull request context information.
Expected Behavior
When a workflow is triggered by pull_request_review_comment or pull_request_review events, the action should:
- Successfully retrieve pull request details and context
- Perform code review analysis with full PR information
- Post meaningful review comments
Actual Behavior
Currently, workflows triggered by these events fail to obtain pull request details, resulting in:
- Incomplete or failed PR review processes
- Missing context for AI-powered review analysis
- Workflow execution without proper PR information
Root Cause
The issue is in the PR information retrieval logic in the example workflow. The current code only handles pull_request, workflow_dispatch, and issue_comment events:
run-gemini-cli/examples/workflows/pr-review/gemini-pr-review.yml
Lines 79 to 82 in c6293c3
| - name: 'Get PR details (pull_request & workflow_dispatch)' | |
| id: 'get_pr' | |
| if: |- | |
| ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} |
run-gemini-cli/examples/workflows/pr-review/gemini-pr-review.yml
Lines 112 to 115 in c6293c3
| - name: 'Get PR details (issue_comment)' | |
| id: 'get_pr_comment' | |
| if: |- | |
| ${{ github.event_name == 'issue_comment' }} |
The logic is missing handling for pull_request_review_comment and pull_request_review events, which means when these events trigger the workflow, pr_number becomes empty, causing the workflow to fail to retrieve PR details.
Detailed design
The solution is to execute pull_request_review_comment and pull_request_review events in the same location as pull_request and workflow_dispatch events.
Additional information
No response