Issue
I want every time I send PR to the master to trigger the deploy process.
But only when I merge this PR to the master.
Which hook event should I use? because none of them is match for what im want.
Also, I checked the PR, but I get events only when PR is create, but not when it merge back to the master.
Solution
When you subscribe to a GitHub webhook, you get all events of that type, and you are responsible for selecting the ones you want. You cannot apply filters to select only some of them.
In this case, you want “Pull Requests” and you'll want to select ones that have the “closed” event with merged set to true. If you only want to target pull requests against master
, then you can filter on that as well.
Answered By - bk2204
Answer Checked By - Pedro (JavaFixing Volunteer)