Limit POST Hook to git branch, not repository, on Bitbucket
bitbucket, git, github
Solution
You can't limit when BitBucket fires its POST hook; but you can use the contents of the POST to make the decision about whether or not to proceed with the deployment. Just parse the JSON that BitBucket sends you and only continue if any of the `"commits"` elements have a `"branch"` of "master", for example.
Problem
Complicated title, let me explain. I want to limit an automatic POST hook when I push to the `master` branch; so it won't fire when I push to the `dev` branch. This is so the app will only deploy to the live servers when the changes have been merged with `master` and the new `master` passes the unit tests. Is this possible?