Custom Bitbucket Commit Message Validation
Overview
When pushing a commit, this custom pre-hook requires users to begin the commit message with a Jira issue key, in the format "[JIRA-ID]". The Jira issue key helps create an audit trail between stories and build deployments. This particular custom script also allows for some exceptions like commit messages starting with "[EMERGENCY]" or "Revert" or commits created by service accounts.
This script was created and provided by GAIN Capital.
Example
I have a code branch with changes ready to push to Bitbucket. To create an audit trail and to avoid an error message, I add a Jira issue key to the beginning of the commit ...