fix(internal/gapicgen): only open draft PR if there are genproto changes
@@ -240,8 +240,10 @@ func (gc *GithubClient) CreateGocloudPR(ctx context.Context, gocloudDir string,
log.Println("creating google-cloud-go PR")
var body string
+ var draft bool
if genprotoPRNum > 0 {
body = gocloudCommitBody + fmt.Sprintf("\n\nCorresponding genproto PR: https://github.com/googleapis/go-genproto/pull/%d\n", genprotoPRNum)
+ draft = true
} else {
body = gocloudCommitBody + "\n\nThere is no corresponding genproto PR.\n"
}
@@ -280,7 +282,7 @@ git push origin $BRANCH_NAME
Body: &body,
Head: github.String(fmt.Sprintf("googleapis:" + gocloudBranchName)),
Base: github.String("master"),
- Draft: github.Bool(true),
+ Draft: github.Bool(draft),
})
if err != nil {
return 0, err
