diff --git a/repository/options.go b/repository/options.go index d0a9c60f..23b62c83 100644 --- a/repository/options.go +++ b/repository/options.go @@ -198,6 +198,18 @@ func (o *GitHubOptions) setDefaultValues(git GitOptions, tplExecutorFunc templat } o.PullRequest.Body = prBody + prMergeCommitTitle, err := tplExecutorFunc(o.PullRequest.Merge.CommitTitle) + if err != nil { + return fmt.Errorf("failed to run template for pull request merge commit title %s: %w", o.PullRequest.Merge.CommitTitle, err) + } + o.PullRequest.Merge.CommitTitle = prMergeCommitTitle + + prMergeCommitMessage, err := tplExecutorFunc(o.PullRequest.Merge.CommitMessage) + if err != nil { + return fmt.Errorf("failed to run template for pull request merge commit message %s: %w", o.PullRequest.Merge.CommitMessage, err) + } + o.PullRequest.Merge.CommitMessage = prMergeCommitMessage + return nil } diff --git a/repository/repository.go b/repository/repository.go index 27999c1a..735d99e7 100644 --- a/repository/repository.go +++ b/repository/repository.go @@ -162,7 +162,7 @@ func (r Repository) Update(ctx context.Context, updaters []update.Updater, optio return true, pr, nil } - err = r.mergePullRequest(ctx, options.GitHub, pr) + err = r.mergePullRequest(ctx, strategy.Options.GitHub, pr) if err != nil { return true, pr, fmt.Errorf("failed to merge Pull Request %s: %w", pr.GetHTMLURL(), err) }