I am using jenkins multibranch pipelines. If a branch is merged and deleted jenkins removes the branch from the pipeline as well.
This is great, but I want to run a command/script when a branch is removed, how can I have jenkins run a command when a branch is removed? Is there a way to have jenkins trigger a job before it removes the branch?
Edit: I should add I'm using bitbucket. It would be neat if Jenkins could trigger an event when purging a branch of a multibranch pipeline. Ideally it wouldn't matter what my git provider is.
For Bitbucket: https://dengelonsoftware.blogspot.fi/2017/01/jenkins-pull-request-and-pipeline.html?m=1 How about webhooks?https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html