Skip to content

Add support for --commit-id on gh pr review #12201

Open

Description

@tgorton617

Describe the feature or problem you’d like to solve

The github API supports a commit_id parameter on the PR review create operation, but this is not supported by gh pr review

Proposed solution

Add a --commit-id parameter to gh pr review.

This will allow automation to submit a review for a specific version of the code, avoiding race conditions that might cause an automation (or human user) to accidentally approve a PR after unexpected changes have been pushed to the branch.

Additional context

I have an automation in a github action that falls victim to this race condition, which is intended to smooth the process of merging PRs when using the stack-pr tool. Specifically, it:

  1. reads the current commit hash
  2. checks if the PR is currently awaiting approval
  3. checks if there is a previously-dismissed review (by a human, not itself) with the same commit hash
  4. if the checks in step 2 and step 3 are true, it approves the PR using gh pr review

If there is a push to the branch between steps 1 and 4, the script winds up approving based on an old version of the branch. Unfortunately running stack-pr submit on an existing set of PRs engineers this situation by updating the target branch (triggering the workflow) and then immediately pushing to the branch.

Activity

  1. github-actions commented on Nov 25, 2025

    @github-actions
    Contributor

    Thank you for your issue! We have categorized it as a feature request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.

    Unless you see the help wanted Contributions welcome label, we are not currently looking for external contributions for this feature.

    If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.

  2. added
    gh-prrelating to the gh pr command
    and removed on Mar 3, 2026
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

    enhancementa request to improve CLIgh-prrelating to the gh pr commandstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions