Validating all git changes from a plugin

I am trying to write a plugin that will validate all git changes that are done to stash. I am 90% there, but the 10% could kill my whole plugin.

I am able to validate all changes that are pushed via a pre-receive hook. That works great.

I am able to validate the merge action on all pull requests via a merge-check. That also works great.

However, a user still has the ability to delete a branch from the stash UI, or alternatively create a branch in the UI. That seems to totally bypass the above hooks. I know that I can control this via branch permissions, but I don't want to use this (since I don't always want to block users from writing or merging to these branches). I'd like to give users as much control on the repo as possible but still have these validations in place.

Is there any plugin hook that I am missing which could let me accept/reject these operations too? Alternatively, if there is a way to blanket disable those actions, that might also be acceptable.

Thanks for any help!



1 answer

0 votes
Timothy Chin Community Champion May 01, 2014

Have you seen the EventListners **?

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

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&nbsp...

663 views 0 4
Read article

Atlassian User Groups

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!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot