Check if gitea is able to squash-merge via API #336

Merged
zeripath merged 5 commits from 6543/go-sdk:pull-merge-check-style into master 2020-05-20 13:01:12 +00:00

View File

@ -155,6 +155,11 @@ type MergePullRequestOption struct {
// MergePullRequest merge a PR to repository by PR id
func (c *Client) MergePullRequest(owner, repo string, index int64, opt MergePullRequestOption) (bool, error) {
if opt.Do == "squash" {
if err := c.CheckServerVersionConstraint(">=1.11.5"); err != nil {
return false, err
}
}
body, err := json.Marshal(&opt)
if err != nil {
return false, err