I am looking to create a Pre-Receive and/or RepositoryMergeCheck hook to run on a repository and block a merge to master branch if an error is thrown. I am reading all the tutorials and it seems like I should have a section called "Merge Checks" in my Repository Settings and an ability to add a "Custom" check, or a section called "Hooks" where I can add these. Not able to find them anywhere.
This is the tutorial link:
https://developer.atlassian.com/server/bitbucket/how-tos/hooks-merge-checks-guide/
Hello Yaniv,
Welcome to the community.
The document you're referring to is Bitbucket server only.
For Bitbucket cloud no such hook or merge check exists.
The app developer community has been passionately communicating this missing feature to the Atlassian Bitbucket team:
https://jira.atlassian.com/browse/BCLOUD-19885
https://jira.atlassian.com/browse/BCLOUD-10471
Please vote and watch these tickets.
We have come across the same problem when we created Workzone for Bitbucket Cloud. The app works around this by taking control over when the PR is ready to merge by checking bitbucket merge restrictions AND merge checks configured in the app.
Hope that helps!
Best, Ulrich
// Izymes
Hi Ulrich, thanks for the response! That makes a lot of sense and I added my votes - would definitely like this feature.
Looking at Workzone, I see the usefulness of it to automate some merging & other behavior, but as far as I can tell, it doesn't support custom merge conditions/commands, correct?
Like running a particular git diff command, or a Django migration check like `python ./manage.py makemigrations --dry-run`, and blocking the code merge if failure...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your feedback, Yaniv.
I understand that you would like to add custom merge conditions and commands.
Have you thought of adding a Bitbucket pipeline or Bitbucket pipeline runner for the PR source branch and have Bitbucket or Workzone control the result of the pipeline runner outcome, i.e. check for successful builds?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think that's where I'm landing, I'll be looking into pipelines. Thanks!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.