github / github/github-mcp-server

pull_request_read drops merge_commit_sha

Đang mở Phù hợp với người mới
#3,235 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Go
Star
33k
Fork
5k
Merge trung bình
2 ngày 1 giờ
Pull request đã merge (30 ngày)
52

Mô tả

### Describe the bug

`pull_request_read` with `method: get` does not return the pull request's `merge_commit_sha`, so there is no way to get from a merged pull request to the commit the merge produced without a second call.

In the source, `GetPullRequest` fetches the full pull request and then returns `convertToMinimalPullRequest(pr)`. `MinimalPullRequest` carries `merged`, `merged_at`, `merged_by`, `head` and `base`, but has no `merge_commit_sha` field, so the value is dropped during conversion. `merge_commit` does not appear anywhere in `pkg/github/pullrequests.go`.

### Affected version

Unknown. Observed through a hosted GitHub MCP integration on 2026-09-06, where the server version is not exposed to me. The code references above are from the repository's default branch on that date and may not match the build that was serving the request.

### Steps to reproduce the behavior

1. Call `pull_request_read` with `method: get` for a merged pull request.
2. Inspect the returned object.

### Expected vs actual behavior

Expected: `merge_commit_sha` is present for a merged pull request, as the REST API returns it.

Actual: the field is absent. Callers fall back to listing commits and matching on merge time or on the pull request number in the commit message, both of which are unreliable on an active branch.

### Logs

None captured beyond the returned object.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start in pkg/github/pullrequests.go, reading GetPullRequest, convertToMinimalPullRequest, and MinimalPullRequest. Add support for retaining the merge commit SHA, then verify that pull_request_read with method get exposes merge_commit_sha for merged pull requests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
github, go
Lĩnh vực
api, backend
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
84/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.