I created a webhook in Bitbucket Cloud (Repository -> Push) that checks if the branch name is valid (bob_12345_ticket_description).
Branch must have the ticket number (12345) or it will throw an error (I tried a few different HTTP errors), with the purpose of stopping the push, come to find out it doesn't work how I thought it would (doesn't stop the push).
Is there a way to stop a push using a webhook?
Hi Michael! I think that in your case you should look into Git hooks:
Common use cases for Git hooks include encouraging a commit policy [...]
pre-commitscript is executed every time you run
git commitbefore Git asks the developer for a commit message or generates a commit object. You can use this hook to inspect the snapshot that is about to be committed. For example, you may want to run some automated tests that make sure the commit doesn’t break any existing functionality.
No arguments are passed to the
pre-commitscript, and exiting with a non-zero status aborts the entire commit.
Hope that helps!
Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot