Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameters to configure merge commit messages to repo #2440

Merged
merged 2 commits into from Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 32 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion github/github-stringify_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions github/repos.go
Expand Up @@ -70,6 +70,10 @@ type Repository struct {
AllowForking *bool `json:"allow_forking,omitempty"`
DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"`
UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"`
SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"`
SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"`
MergeCommitTitle *string `json:"merge_commit_title,omitempty"`
MergeCommitMessage *string `json:"merge_commit_message,omitempty"`
Topics []string `json:"topics,omitempty"`
Archived *bool `json:"archived,omitempty"`
Disabled *bool `json:"disabled,omitempty"`
Expand Down Expand Up @@ -374,6 +378,10 @@ type createRepoRequest struct {
AllowForking *bool `json:"allow_forking,omitempty"`
DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"`
UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"`
SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"`
SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"`
MergeCommitTitle *string `json:"merge_commit_title,omitempty"`
MergeCommitMessage *string `json:"merge_commit_message,omitempty"`
}

// Create a new repository. If an organization is specified, the new
Expand Down Expand Up @@ -420,6 +428,10 @@ func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repo
AllowForking: repo.AllowForking,
DeleteBranchOnMerge: repo.DeleteBranchOnMerge,
UseSquashPRTitleAsDefault: repo.UseSquashPRTitleAsDefault,
SquashMergeCommitTitle: repo.SquashMergeCommitTitle,
SquashMergeCommitMessage: repo.SquashMergeCommitMessage,
MergeCommitTitle: repo.MergeCommitTitle,
MergeCommitMessage: repo.MergeCommitMessage,
}

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