title: How to call a webhook only when a pull request has been successfully merged into master?
body: <p>We are using <a href="https://docs.microsoft.com/en-us/azure/devops/service-hooks/services/webhooks?view=azure-devops" rel="nofollow noreferrer">Azure DevOps webhooks</a> to call into our service from our customers projects.</p>
  
  <p>The intention is to seamlessly perform some actions over their repository once they've completed a PR into master branch.</p>
  
  <p>In my tests, I've set up a webhook defined like so: <a href="https://i.stack.imgur.com/VsTid.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VsTid.png" alt="Event hook subscription settings"></a></p>
  
  <p>You can see that we've configured our webhook to only be called on "pull request merge attempted" on a specific repo, into "master" branch when the merge is successful.</p>
  
  <p>What I've observed is that this causes our webhook to be hit any time a commit is added to a pull request, instead of only when the pull request has been completed.</p>
  
  <p>What is the correct mechanism to perform an action only on successful completed PRs into a specific branch?</p>
  
  <p>Is there something we should do on our code to validate or is it something we should get our customers to set up differently in the service hooks subscription?</p>