Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit d49aa43

Browse files
author
Hubot
committed
Sync changes from upstream repository
1 parent 8b34f28 commit d49aa43

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Preview Squash Support for the Pull Request Merge API
3+
author_name: scottjg
4+
---
5+
6+
With the [recent addition](https://github.com/blog/2141-squash-your-commits) of squashing Pull Requests via the merge button, we're adding support to squash Pull Requests in the API as well. You can squash a pull request in the [Pull Request Merge API][docs] during the preview period by providing a custom [media type][media-type] in the `Accept` header:
7+
8+
application/vnd.github.polaris-preview
9+
10+
For example:
11+
12+
``` command-line
13+
curl "https://api.github.com/repos/github/hubot/pulls/123/merge" \
14+
-XPUT \
15+
-H 'Authorization: token TOKEN' \
16+
-H "Accept: application/vnd.github.polaris-preview" \
17+
-d '{
18+
"squash": true,
19+
"commit_title": "Never tell me the odds"
20+
}'
21+
```
22+
23+
During the preview period, we may change aspects of these API methods based on developer feedback. We will announce the changes here on the developer blog, but we will not provide advance notice.
24+
25+
If you have any questions or feedback, please [let us know][contact].
26+
27+
[media-type]: /v3/media
28+
[docs]: /v3/pulls/#merge-a-pull-request-merge-button
29+
[contact]: https://github.com/contact?form%5Bsubject%5D=Squash+API+Preview

content/v3/pulls.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,26 @@ Note: The response includes a maximum of 250 commits. If you are working with a
187187

188188
Name | Type | Description
189189
-----|------|-------------
190+
{% if page.version == 'dotcom' or page.version >= 2.6 %}`commit_title`|`string`| Title for the automatic commit message.{% endif %}
190191
`commit_message`|`string`| Extra detail to append to automatic commit message.
191192
`sha`|`string`| SHA that pull request head must match to allow merge
193+
{% if page.version == 'dotcom' or page.version >= 2.6 %}`squash`|`boolean`| Commit a single commit to the head branch.{% endif %}
192194

195+
{% if page.version == 'dotcom' or page.version >= 2.6 %}
196+
197+
{{#tip}}
198+
199+
The `commit_title` and `squash` parameters are currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the [blog post](/changes/2016-04-01-squash-api-preview) for full details.
200+
201+
To access the API during the preview period, you must provide a custom [media type](/v3/media) in the `Accept` header:
202+
203+
```
204+
application/vnd.github.polaris-preview+json
205+
```
206+
207+
{{/tip}}
208+
209+
{% endif %}
193210

194211
### Response if merge was successful
195212

0 commit comments

Comments
 (0)