8000 Output merge commit hash for Merged PR's in `gh pr view ` · Issue #2306 · cli/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Output merge commit hash for Merged PR's in gh pr view  #2306
Closed
@therealplato

Description

@therealplato

Describe the feature or problem you’d like to solve

I'm looking to automate a task where I document specific merged PR's in another system. I can obtain the author, PR number, and PR title by parsing the current output of gh pr view 123. I can derive the PR link from the PR number (I already know the repo.)

The information I'd like to have available is the commit hash representing the merge commit created when the PR was squashed and merged.

Proposed solution

For a PR with status Merged, append the merge commit hash in the status string of gh pr view:

$ gh repo clone gobridge/gopher
$ gh pr view 31
post alternate platform song links
Merged in 22090be • therealplato wants to merge 6 commits into master from songlink



  I want to hear posts in #howplaying without creating a spotify account or  <snip>

Additional context

I only use squash and merge. I'm not sure if other options would break this approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0