Skip to content

Commit

Permalink
fix(internal/gapicgen): only open draft PR if there are genproto chan…
Browse files Browse the repository at this point in the history
…ges (#2634)
  • Loading branch information
codyoss committed Jul 23, 2020
1 parent 0876c6a commit 188927f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/gapicgen/cmd/genbot/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 188927f

Please sign in to comment.