Skip to content

Auto-generated workflows fail to retrieve PR details for pull_request_review_comment and pull_request_review events #150

@k35o

Description

@k35o

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:

- name: 'Get PR details (pull_request & workflow_dispatch)'
id: 'get_pr'
if: |-
${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}

- 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

Metadata

Metadata

Labels

kind/bugSomething isn't workingpriority/p1Important and should be addressed in the near term

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions