You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Call pull_request_read with method: get for a merged pull request.
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.
Confirmed on the current default branch. MinimalPullRequest in pkg/github/minimal_types.go carries merged, merged_at, merged_by, head and base, but has no merge_commit_sha field, and convertToMinimalPullRequest in the same file never reads pr.GetMergeCommitSHA(). The upstream go-github PullRequest type does have MergeCommitSHA, so the value is available and just isn't copied over.
Fix is a one-field addition to the struct plus one line in the converter:
Activity
thejdubb02 commentedon Sep 25, 2026
Confirmed on the current default branch. MinimalPullRequest in pkg/github/minimal_types.go carries merged, merged_at, merged_by, head and base, but has no merge_commit_sha field, and convertToMinimalPullRequest in the same file never reads pr.GetMergeCommitSHA(). The upstream go-github PullRequest type does have MergeCommitSHA, so the value is available and just isn't copied over.
Fix is a one-field addition to the struct plus one line in the converter:
and in convertToMinimalPullRequest:
Happy to open a PR with just that change if useful.
Include merge_commit_sha in the minimal pull request result