Skip to content

Commit a686455

Browse files
committed
add Draft to issue state
1 parent b231e6c commit a686455

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pkg/cmd/pr/create/create.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func createRun(opts *CreateOptions) (err error) {
183183
}
184184

185185
message := "\nCreating pull request for %s into %s in %s\n\n"
186-
if opts.IsDraft {
186+
if state.Draft {
187187
message = "\nCreating draft pull request for %s into %s in %s\n\n"
188188
}
189189

@@ -357,6 +357,7 @@ func NewIssueState(ctx CreateContext, opts CreateOptions) (*shared.IssueMetadata
357357
Labels: opts.Labels,
358358
Projects: opts.Projects,
359359
Milestones: milestoneTitles,
360+
Draft: opts.IsDraft,
360361
}
361362

362363
if opts.Autofill || !opts.TitleProvided || !opts.BodyProvided {
@@ -538,7 +539,7 @@ func submitPR(opts CreateOptions, ctx CreateContext, state shared.IssueMetadataS
538539
params := map[string]interface{}{
539540
"title": state.Title,
540541
"body": state.Body,
541-
"draft": opts.IsDraft,
542+
"draft": state.Draft,
542543
"baseRefName": ctx.BaseBranch,
543544
"headRefName": ctx.HeadBranchLabel,
544545
}

pkg/cmd/pr/shared/survey.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ const (
2626
type IssueMetadataState struct {
2727
Type metadataStateType
2828

29+
Draft bool
30+
2931
Body string
3032
Title string
3133

0 commit comments

Comments
 (0)