allowSquashMerge : "Default commit message" parameters are missing
allowSquashMerge is only accepting an "enabled" parameter whereas the GitHub API is gving the ability to set the "Default commit message" (default message, PR title, PR title + commit details, PR title + description)
Any plan to add it ? Need a PR ?
PRs welcome!
I have been working on issue [#1964]regarding the allowSquashMerge method in the GHRepositoryBuilder.java file. The issue indicates that a PR is welcome to add the ability to set the default commit message for squash merges.
I propose modifying the allowSquashMerge method to accept an additional parameter for the default commit message. This change will allow users to specify a default commit message when enabling squash merges. I plan to update the corresponding usages and tests to reflect this change.
Please let me know if you have any feedback or suggestions.
Thank you!
The create and update endpoints for repositories take a number of parameters: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#update-a-repository
allow_squash_merge is still a boolean, so you should not change the allowSquashMerge() method.
There are other parameters that control commit messages and titles.
squash_merge_commit_title- Can be one of: PR_TITLE, COMMIT_OR_PR_TITLEsquash_merge_commit_message- Can be one of: PR_BODY, COMMIT_MESSAGES, BLANKmerge_commit_title- Can be one of: PR_TITLE, MERGE_MESSAGEmerge_commit_message- Can be one of: PR_BODY, PR_TITLE, BLANK
To implement this feature, add new methods GHRepositoryBuilder for these other endpoint parameters. NOTE: the above are technically string values but should be implemented as enum parameters here.