@@ -79,7 +79,7 @@ var globalPreservePatterns = []string{
7979// GitHubClient is an abstraction over the GitHub client.
8080type GitHubClient interface {
8181 GetRawContent (ctx context.Context , path , ref string ) ([]byte , error )
82- CreatePullRequest (ctx context.Context , repo * github.Repository , remoteBranch , remoteBase , title , body string ) (* github.PullRequestMetadata , error )
82+ CreatePullRequest (ctx context.Context , repo * github.Repository , remoteBranch , remoteBase , title , body string , isDraft bool ) (* github.PullRequestMetadata , error )
8383 AddLabelsToIssue (ctx context.Context , repo * github.Repository , number int , labels []string ) error
8484 GetLabels (ctx context.Context , number int ) ([]string , error )
8585 ReplaceLabels (ctx context.Context , number int , labels []string ) error
@@ -126,8 +126,11 @@ type commitInfo struct {
126126 // api is the api path of a library, only set this value during api onboarding.
127127 api string
128128 // library is the ID of a library, only set this value during api onboarding.
129- library string
129+ library string
130+ // prBodyBuilder is a callback function for building the pull request body
130131 prBodyBuilder func () (string , error )
132+ // isDraft declares whether or not to create the pull request as a draft.
133+ isDraft bool
131134}
132135
133136type commandRunner struct {
@@ -423,7 +426,7 @@ func commitAndPush(ctx context.Context, info *commitInfo) error {
423426 return fmt .Errorf ("failed to create pull request body: %w" , err )
424427 }
425428
426- pullRequestMetadata , err := info .ghClient .CreatePullRequest (ctx , gitHubRepo , branch , info .branch , title , prBody )
429+ pullRequestMetadata , err := info .ghClient .CreatePullRequest (ctx , gitHubRepo , branch , info .branch , title , prBody , info . isDraft )
427430 if err != nil {
428431 return fmt .Errorf ("failed to create pull request: %w" , err )
429432 }
0 commit comments