Preview Rebase Support for the Pull Request Merge API

With the recent addition of rebasing Pull Requests via the merge button, we're adding support to rebasing Pull Requests in the API as well. We're extending the preview squash support to include the rebase merge method. You can rebase a pull request in the Pull Request Merge API during the preview period by providing a custom media type in the Accept header:

application/vnd.github.polaris-preview

For example:

curl "https://api.github.com/repos/github/hubot/pulls/123/merge" \
  -XPUT \
  -H 'Authorization: token TOKEN' \
  -H "Accept: application/vnd.github.polaris-preview" \
  -d '{
    "merge_method": "rebase",
    "commit_title": "Never tell me the odds"
  }'

In addition, we're extending the Squash API Preview to support fetching and updating repository settings for merging pull requests. You can now determine whether merging with squashing, rebasing and merge commits are allowed for a repository, and also change those settings, by providing the same custom media type in the Accept header.

For example:

curl "https://api.github.com/repos/github/hubot" \
  -H 'Authorization: token TOKEN' \
  -H "Accept: application/vnd.github.polaris-preview"

{
  "id": 2278524,
  "name": "hubot",
  "full_name": "github/hubot",
  ...
  "allow_rebase_merge": true,
  "allow_squash_merge": true,
  "allow_merge_commit": true,
  ...
}

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.

If you have any questions or feedback, please let us know.