Skip to content

Commit

Permalink
feat: av stack submit --draft add the ability to open PRs as draft (#…
Browse files Browse the repository at this point in the history
…455)

Small PR adding the ability to open draft PRs when doing submit .


Closes #422
  • Loading branch information
Brookke authored Nov 11, 2024
1 parent 7e092e5 commit 6449b42
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/av/stack_submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

var stackSubmitFlags struct {
Current bool
Draft bool
}

var stackSubmitCmd = &cobra.Command{
Expand Down Expand Up @@ -78,11 +79,14 @@ If the --current flag is given, this command will create pull requests up to the
for _, branchName := range branchesToSubmit {
// TODO: should probably commit database after every call to this
// since we're just syncing state from GitHub

draft := config.Av.PullRequest.Draft || stackSubmitFlags.Draft

result, err := actions.CreatePullRequest(
ctx, repo, client, tx,
actions.CreatePullRequestOpts{
BranchName: branchName,
Draft: config.Av.PullRequest.Draft,
Draft: draft,
NoOpenBrowser: true,
},
)
Expand Down Expand Up @@ -134,4 +138,8 @@ func init() {
&stackSubmitFlags.Current, "current", false,
"only create pull requests up to the current branch",
)
stackSubmitCmd.Flags().BoolVar(
&stackSubmitFlags.Draft, "draft", false,
"create pull requests in draft mode",
)
}

0 comments on commit 6449b42

Please sign in to comment.