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

allowSquashMerge : "Default commit message" parameters are missing #1964

Open
sbouchexbellomie-Philips opened this issue Oct 3, 2024 · 3 comments

Comments

@sbouchexbellomie-Philips

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 ?

@bitwiseman
Copy link
Member

PRs welcome!

@shivangi-jindal
Copy link

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!

@bitwiseman
Copy link
Member

bitwiseman commented Jan 2, 2025

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_TITLE
  • squash_merge_commit_message - Can be one of: PR_BODY, COMMIT_MESSAGES, BLANK
  • merge_commit_title - Can be one of: PR_TITLE, MERGE_MESSAGE
  • merge_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants