Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Schema Inaccuracy] "Merge a pull request", commit_message body parameter #4340

Open
gsnedders opened this issue Nov 28, 2024 · 1 comment
Open

Comments

@gsnedders
Copy link

gsnedders commented Nov 28, 2024

Schema Inaccuracy

c.f. https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#merge-a-pull-request

https://github.com/github/rest-api-description/blob/50bf833eb2c1288fb78419d9e4d359fda3c3ccbe/descriptions/api.github.com/api.github.com.yaml#L36643-L36645

This documents:

commit_message string
Extra detail to append to automatic commit message.

However, it seems like, at least for the "squash" merge method, it replaces the commit_message, rather than appending it.

Expected

I hoped it would, like the behaviour of "Squash & Merge" in the Web UI, allow me to specify the entire commit message.

I fear it would, as documented, keep the auto-generated commit message and append a string there.

Reproduction Steps

gsnedders@gsnedders-lonnie tmp-symmetrical-meme % gh api \             
  --method PUT \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/gsnedders/tmp-symmetrical-meme/pulls/2/merge \
   -f "commit_title=Fix README" -f "commit_message=Will this be appended or replace the old body?" -f "merge_method=squash"

This merge entirely replaced the old body, rather than appended it as documented.

@shiftkey
Copy link
Member

shiftkey commented Dec 2, 2024

👋 Thanks for the feedback. I've reached out to the team that handles this API to confirm this is the right change, and we'll follow up if there are any additional questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants