Skip to content

Commit 01c8feb

Browse files
authored
Add parameters to configure merge commit messages to repo (#2440)
1 parent e5e45da commit 01c8feb

File tree

4 files changed

+89
-1
lines changed

4 files changed

+89
-1
lines changed

github/github-accessors.go

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 40 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-stringify_test.go

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/repos.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ type Repository struct {
7070
AllowForking *bool `json:"allow_forking,omitempty"`
7171
DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"`
7272
UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"`
73+
SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE"
74+
SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK"
75+
MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE"
76+
MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK"
7377
Topics []string `json:"topics,omitempty"`
7478
Archived *bool `json:"archived,omitempty"`
7579
Disabled *bool `json:"disabled,omitempty"`
@@ -374,6 +378,10 @@ type createRepoRequest struct {
374378
AllowForking *bool `json:"allow_forking,omitempty"`
375379
DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"`
376380
UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"`
381+
SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"`
382+
SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"`
383+
MergeCommitTitle *string `json:"merge_commit_title,omitempty"`
384+
MergeCommitMessage *string `json:"merge_commit_message,omitempty"`
377385
}
378386

379387
// Create a new repository. If an organization is specified, the new
@@ -420,6 +428,10 @@ func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repo
420428
AllowForking: repo.AllowForking,
421429
DeleteBranchOnMerge: repo.DeleteBranchOnMerge,
422430
UseSquashPRTitleAsDefault: repo.UseSquashPRTitleAsDefault,
431+
SquashMergeCommitTitle: repo.SquashMergeCommitTitle,
432+
SquashMergeCommitMessage: repo.SquashMergeCommitMessage,
433+
MergeCommitTitle: repo.MergeCommitTitle,
434+
MergeCommitMessage: repo.MergeCommitMessage,
423435
}
424436

425437
req, err := s.client.NewRequest("POST", u, repoReq)

0 commit comments

Comments
 (0)