github / github/github-mcp-server

pull_request_read drops merge_commit_sha

Aperta Adatta ai principianti
#3,235 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Go
Stelle
33k
Fork
5k
Merge medio
2g 1h
PR unite (30g)
52

Descrizione

### 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia da pkg/github/pullrequests.go leggendo GetPullRequest, convertToMinimalPullRequest e MinimalPullRequest. Aggiungi il supporto per conservare lo SHA del commit di merge, quindi verifica che pull_request_read con il metodo get esponga merge_commit_sha per le pull request unite.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
github, go
Ambito
api, backend
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Attiva
Chiarezza
Specificata chiaramente
Idoneità per principianti
84/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.