Check if gitea is able to squash-merge via API (#336)
Check if gitea is able to squash-merge via API Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/336 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: CirnoT <cirnot@noreply.gitea.io>
This commit is contained in:
parent
bb6248f50d
commit
2cc36f912f
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue