Skip to content

Commit 49e9ab1

Browse files
authored
add draft (#297)
Signed-off-by: Edward Kim <[email protected]>
1 parent 90ada25 commit 49e9ab1

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

bitbucket.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ type PullRequestsOptions struct {
314314
States []string `json:"states"`
315315
Query string `json:"query"`
316316
Sort string `json:"sort"`
317+
Draft bool `json:"draft"`
317318
ctx context.Context
318319
}
319320

@@ -665,8 +666,8 @@ func (dk *DeployKeyOptions) WithContext(ctx context.Context) *DeployKeyOptions {
665666
}
666667

667668
type SSHKeyOptions struct {
668-
Owner string `json:"owner"`
669-
Uuid string `json:"uuid"`
670-
Label string `json:"label"`
671-
Key string `json:"key"`
669+
Owner string `json:"owner"`
670+
Uuid string `json:"uuid"`
671+
Label string `json:"label"`
672+
Key string `json:"key"`
672673
}

pullrequests.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,14 @@ func (p *PullRequests) buildPullRequestBody(po *PullRequestsOptions) (string, er
242242
body["message"] = po.Message
243243
}
244244

245-
if po.CloseSourceBranch == true || po.CloseSourceBranch == false {
245+
if po.CloseSourceBranch || !po.CloseSourceBranch {
246246
body["close_source_branch"] = po.CloseSourceBranch
247247
}
248248

249+
if po.Draft {
250+
body["draft"] = true
251+
}
252+
249253
data, err := json.Marshal(body)
250254
if err != nil {
251255
return "", err

0 commit comments

Comments
 (0)