diff --git a/README.md b/README.md index 88b892c..5af4599 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,6 @@ Available Commands: Flags: -a, --approve Pass an optional approve flag as an argument which will only approve and not merge selected repos. --close Pass an optional argument to close a pull request. - --commit-msg string Add a custom message when approving a pull request. -c, --config string Pass an optional config file as an argument with list of repositories. -d, --delay int Set the value of delay, which will determine how long to wait between mergeing pull requests. Default is (6) seconds. (default 6) -e, --enterprise-base-url string For Github Enterprise users, you can pass your enterprise base. Format: http(s)://[hostname]/ diff --git a/pkg/cli/gomerge/gomerge.go b/pkg/cli/gomerge/gomerge.go index 4dfe229..3804df1 100644 --- a/pkg/cli/gomerge/gomerge.go +++ b/pkg/cli/gomerge/gomerge.go @@ -22,7 +22,6 @@ func New() (c *cobra.Command) { c.PersistentFlags().BoolP("close", "", false, "Pass an optional argument to close a pull request.") c.PersistentFlags().IntP("delay", "d", 6, "Set the value of delay, which will determine how long to wait between mergeing pull requests. Default is (6) seconds.") c.PersistentFlags().StringP("enterprise-base-url", "e", "", "For Github Enterprise users, you can pass your enterprise base. Format: http(s)://[hostname]/") - c.PersistentFlags().StringP("commit-msg", "", "", "Add a custom message when approving a pull request.") c.MarkFlagRequired("token") @@ -35,7 +34,6 @@ func New() (c *cobra.Command) { viper.BindPFlag("delay", c.PersistentFlags().Lookup("delay")) viper.BindPFlag("close", c.PersistentFlags().Lookup("close")) viper.BindPFlag("enterprise-base-url", c.PersistentFlags().Lookup("enterprise-base-url")) - viper.BindPFlag("commit-msg", c.PersistentFlags().Lookup("commit-msg")) c.AddCommand(list.NewCommand()) c.AddCommand(version.NewCommand()) diff --git a/pkg/cli/list/list.go b/pkg/cli/list/list.go index 9ff60a2..9622084 100644 --- a/pkg/cli/list/list.go +++ b/pkg/cli/list/list.go @@ -86,7 +86,6 @@ func NewCommand() (c *cobra.Command) { pullRequestsArray := []*gitclient.PullRequest{} table := initTable() - ctx = commitMsg(ctx, viper.GetString("commit-msg")) var org string var repositories []string = nil diff --git a/pkg/gitclient/client.go b/pkg/gitclient/client.go index 258d5cf..a0014c7 100644 --- a/pkg/gitclient/client.go +++ b/pkg/gitclient/client.go @@ -194,14 +194,12 @@ func ApprovePullRequest(ghClient *githubv4.Client, ctx context.Context, prId git fmt.Printf("PR %v: %v\n", prId, review.State) } } -func MergePullRequest(ghClient *githubv4.Client, ctx context.Context, prId githubv4.ID, mergeMethod *githubv4.PullRequestMergeMethod, skip bool) { - commitMessage := githubv4.String(defaultCommitMsg()) +func MergePullRequest(ghClient *githubv4.Client, ctx context.Context, prId githubv4.ID, mergeMethod *githubv4.PullRequestMergeMethod, skip bool) { input := githubv4.MergePullRequestInput{ - PullRequestID: prId, - CommitHeadline: &commitMessage, - MergeMethod: mergeMethod, + PullRequestID: prId, + MergeMethod: mergeMethod, } var m struct { @@ -255,10 +253,6 @@ func ClosePullRequest(ghClient *githubv4.Client, ctx context.Context, prId githu } -func defaultCommitMsg() string { - return "Merged by gomerge CLI." -} - func DefaultApproveMsg() string { return `PR has been approved by [GoMerge](https://github.com/Cian911/gomerge) tool. :rocket:` } diff --git a/pkg/gitclient/client_test.go b/pkg/gitclient/client_test.go index e7ed18c..1c1469c 100644 --- a/pkg/gitclient/client_test.go +++ b/pkg/gitclient/client_test.go @@ -4,17 +4,6 @@ import ( "testing" ) -func TestDefaultCommitMsg(t *testing.T) { - t.Run("It returns a default commit message", func(t *testing.T) { - got := defaultCommitMsg() - want := "Merged by gomerge CLI." - - if got != want { - t.Errorf("got %s, want %s", got, want) - } - }) -} - func TestDefaultApproveMsg(t *testing.T) { t.Run("It returns a default approve message.", func(t *testing.T) { got := DefaultApproveMsg()