Reputation: 920
I have a lot of build versions by Git branches. So now I'd like to clean them up with the condition that whenever any branch is merged to the development branch, Jenkins will rollback/delete that branch. Assume that I have a script that will rollback/delete the branch.
My issue is how to get a notification when any branch has been merged to the development branch?
Upvotes: 1
Views: 956
Reputation: 12023
This behavior can be achieved using github webhook on PullRequestEvent.
The event payload provides action information, you should test that the action=closed, merged=true and base.ref=develop
You can see the an example for the json payload here: "Merging a pull request should trigger a event for the webhooks"
Upvotes: 1