As @Saxea _Flowie_ suggested you could build a Forge app for this.
The Better Commit Policy Connector Bitbucket Cloud app can enforce certain rules on pull requests like:
With some creative configuration these may help you to enforce a policy, even if that is precise matching between a commit message and the pull request title. Those pull requests that are not satisfying the policy cannot be merged until the author fixes every problem:
Give it a try.
(This app is developed and supported by our team.)
Bitbucket doesn't support it out of the box, but you could extend it using Forge to implement it yourself. You could use a check to enforce it - which would just block but not change or set it automatically.
Alternatively we have an Bitbucket cloud app, Flowie, which allow you to disable the commit message input and set a template.
In your case the relevant bit of the config would look something like:
merge({
strategies: "squash",
commitMessageTemplate: ({pullRequest}) => `${pullRequest.title}`,
// Disable all options, including the commit message
select: false,
}),
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.