Skip to content

[Bug] run-gemini-cli@v0 fetches wrong PR even when correct repo and PR number provided #251

Closed

Description

@eshwarvijay

TL;DR

Description

The google-github-actions/run-gemini-cli@v0 action is failing to fetch pull request data for the correct repository and PR number, instead trying fallback PRs (1–6) and returning 404 errors.

Reproduction Steps

  1. Use Gemini workflow on pull_request event, triggered for PR # in amber-ml/amber-ml.
  2. Workflow log shows:
    Then Gemini tries PRs 1 through 6 and finally says unable to proceed with the code review.

Expected behavior

Gemini should fetch and review the exact PR it was triggered for—no arbitrary probing of PRs 1–6.

Observed behavior

Gemini disregards correct PULL_REQUEST_NUMBER and REPOSITORY, instead attempting PRs 1–6, all of which fail with 404.

Action YAML

jobs:
gemini-code-review:
 runs-on: ...
 env:
   PULL_REQUEST_NUMBER: ${{ github.event.number }}
   REPOSITORY: ${{ github.repository }}
 steps:
   - uses: google-github-actions/run-gemini-cli@v0
     with:
       gemini_cli_version: ${{ vars.GEMINI_CLI_VERSION }}
       gemini_api_key: ${{ secrets.GEMINI_API }}
       use_vertex_ai: false
       use_gemini_code_assist: false
       settings: |
         { ... }
       prompt: |
         Review this PR...

Log output

Warning: Unexpected input(s) 'google_api_key', 'gemini_debug'
Error executing tool get_pull_request: ... pulls/<actual-number>: 404 Not Found
... retries PRs 1–6 with the same error

Additional information

No response

Activity

  1. gemini-cli commented on Aug 28, 2025

    @gemini-cli
    Contributor

    🤖 Hi @eshwarvijay, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

  2. added this to the v0.1.13 milestone on Aug 28, 2025
  3. michael-airspace commented on Sep 2, 2025

    @michael-airspace

    Neat idea, but gemini is pulling random old PRs to review which don't match current PR.

  4. hassib-ashouri commented on Sep 3, 2025

    @hassib-ashouri

    How is this working on this repo; or is not working here too??

  5. tleonhardt commented on Sep 14, 2025

    @tleonhardt

    We have seen this problem as well. It appears to work correctly when a PR is first created. However, sometimes when a manual re-review is requested by posting a @gemini-cli /review comment in the PR, sometimes it works, but most of the time it goes out and reviews some old PR that has already been merged.

    Here is a specific example where we saw this recently in the cmd2 open-source Python library repo:

  6. modified the milestones: v0.1.13, v0.1.14 on Sep 16, 2025
  7. TonyDowney commented on Sep 22, 2025

    @TonyDowney

    Can confirm; I'm using this PR reviewer on a number of private repositories. In most, it works fine, but in one repository in particular, it consistently fails. Reviewing by opening a PR, or by explicitly requesting a review, returns the comment "🤖 Hi @TonyDowney, I've received your request, and I'm working on it now! You can track my progress in the logs for more details."

    Then, either the action completes with no review posted anywhere, or I get an email notifying me that a review was done on a completely different (closed) PR.

    I grabbed the logs from three runs (a clean run, a run where no review was posted, and a run where it reviewed the wrong PR) and all three sets of logs are identical, save some timestamps.

  8. michalszelagsonos commented on Oct 19, 2025

    @michalszelagsonos

    I was seeing this issue from time to time and I after updating the prompt in the review workflow with explicit repository and PR number instructions, it does the right thing every time.

    Looks like the latest version on main now includes the repository and PR number in the Input data section which is what I did to fix this. I suspect this is no longer a problem.

  9. modified the milestones: v0.1.14, v0.1.15 on Oct 23, 2025
  10. removed this from the v0.1.15 milestone on Nov 18, 2025
  11. MJjainam commented on Dec 2, 2025

    @MJjainam
    Contributor

    This must be fixed in the latest release.
    Please re-open if this exists.

  12. added this to the v0.1.16 milestone on Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/qualityTracks quality issuesarea/workflowskind/bugSomething isn't workingpriority/p1Important and should be addressed in the near term

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions