Feature request: Enforce merge strategy based on source and target branches #165095
Replies: 3 comments
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
@rlos-dev Currently I'm using a job in my CI workflow to post a comment with the merge strategy to be used. It is very similar to how coverage reports are posted. But this is still not a watertight solution for this issue. There is also a way to disable all merge strategies and allow the bot to do it when you post a special comment like A native feature to achieve this would be really helpful. |
|
Duplicate of https://github.com/orgs/community/discussions/8196#discussioncomment-18935780 ? |
Uh oh!
There was an error while loading. Please reload this page.
Select Topic Area
Product Feedback
Body
Hello GitHub team and community,
I’m currently using Git Flow with the following merge strategy:
develop, I require squash merges to keep a clean linear history.mainintodevelop(integration PRs after production deploy), I require merge commits to preserve the full history.Currently, GitHub allows enabling/disabling merge commit, squash, or rebase merges globally per repository or based on the target branch via branch rulesets.
However, it is not possible to restrict allowed merge types depending on the source branch of the PR.
This limitation prevents enforcing complex workflows where the merge strategy depends on both the source and target branches.
It would be very helpful to have a feature that allows:
Thank you for considering this feature!
I’m curious if others in the community have similar needs or workarounds.
All reactions