Hi guys,
Is it possible to validate commit messages that you write on merge from bitbucket UI?
The idea is that I would like to use conventional commits so I can generate a proper changelog using semantic release.
The problem is that we squash our commits on merge and the developer should provide a new message when we "squash merge" feature into the dev branch.
I want somehow ensure that this message is in a proper format that can be later used by "semantic release" to generate the changelog.
Is there any way to do this?
Hi Viktor and welcome to the community!
I'm afraid that this is not possible at the moment, as Bitbucket Cloud doesn't support pre-receive hooks that would allow you to configure this. We have a feature request about this in our issue tracker:
I would suggest adding your vote and a comment with your use case to that feature request to express your interest. You can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.
Implementation of new features is done as per our policy here and any updates will be posted in the feature request.
We also have another feature request for the ability to customize the PR default commit message, although this concerns providing a template rather than enforcing it:
Kind regards,
Theodora
The Better Commit Policy app provides a custom merge check that can check if commit messages match a given regex. Plus, you can set up a regex to enforce the conventional commits format.
So far so good.
In your workflow the question is the timing. If I understood correctly, you squash while merging, and I am not sure if Bitbucket invokes the merge checks before or after your developer entered the commit message for the squashed commit.
It is definitely worth a test:
(Discl. this app is developed and supported by our team.)
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.