(ctx context.Context, pr *github.PullRequest, mergeMethod genclient.PullRequestMergeMethod)
| 565 | } |
| 566 | |
| 567 | func (c *client) MergePullRequest(ctx context.Context, |
| 568 | pr *github.PullRequest, mergeMethod genclient.PullRequestMergeMethod) { |
| 569 | log.Debug(). |
| 570 | Interface("PR", pr). |
| 571 | Str("mergeMethod", string(mergeMethod)). |
| 572 | Msg("MergePullRequest") |
| 573 | |
| 574 | var err error |
| 575 | if c.config.Repo.MergeQueue { |
| 576 | _, err = c.api.AutoMergePullRequest(ctx, genclient.EnablePullRequestAutoMergeInput{ |
| 577 | PullRequestId: pr.ID, |
| 578 | MergeMethod: &mergeMethod, |
| 579 | }) |
| 580 | } else { |
| 581 | _, err = c.api.MergePullRequest(ctx, genclient.MergePullRequestInput{ |
| 582 | PullRequestId: pr.ID, |
| 583 | MergeMethod: &mergeMethod, |
| 584 | }) |
| 585 | } |
| 586 | if err != nil { |
| 587 | log.Fatal(). |
| 588 | Str("id", pr.ID). |
| 589 | Int("number", pr.Number). |
| 590 | Str("title", pr.Title). |
| 591 | Err(err). |
| 592 | Msg("pull request merge failed") |
| 593 | } |
| 594 | check(err) |
| 595 | |
| 596 | if c.config.User.LogGitHubCalls { |
| 597 | fmt.Printf("> github merge %d : %s\n", pr.Number, pr.Title) |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | func (c *client) ClosePullRequest(ctx context.Context, pr *github.PullRequest) { |
| 602 | log.Debug().Interface("PR", pr).Msg("ClosePullRequest") |
nothing calls this directly
no test coverage detected