You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-07-05 00:59:04 +02:00
feat(github): allow to open PRs as drafts (#4054)
This allows to open a pull requests as a draft. Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
7c6d6561b5
commit
f6b9ccbd8f
@ -170,6 +170,7 @@ func (c *githubClient) OpenPullRequest(
|
||||
ctx *context.Context,
|
||||
base, head Repo,
|
||||
title string,
|
||||
draft bool,
|
||||
) error {
|
||||
c.checkRateLimit(ctx)
|
||||
if base.Branch == "" {
|
||||
@ -181,13 +182,15 @@ func (c *githubClient) OpenPullRequest(
|
||||
}
|
||||
log := log.
|
||||
WithField("base", headString(base, Repo{})).
|
||||
WithField("head", headString(base, head))
|
||||
WithField("head", headString(base, head)).
|
||||
WithField("draft", draft)
|
||||
log.Info("opening pull request")
|
||||
pr, res, err := c.client.PullRequests.Create(ctx, base.Owner, base.Name, &github.NewPullRequest{
|
||||
Title: github.String(title),
|
||||
Base: github.String(base.Branch),
|
||||
Head: github.String(headString(base, head)),
|
||||
Body: github.String("Automatically generated by [GoReleaser](https://goreleaser.com)"),
|
||||
Draft: github.Bool(draft),
|
||||
})
|
||||
if err != nil {
|
||||
if res.StatusCode == 422 {
|
||||
|
Reference in New Issue
Block a user