I am developing an app that would detect that something was merged in specific branch and take some actions based on that. In order to solve my problem I need to find the name of a branch that was merged to the branch I monitor.
Let's say GitHub sends me "everything" and my script must react when "some-branch" is merged to branch "Tests". Also my script must be able to detect the name of merged branch (in this case "some-branch").
Only solution I found so far - is to read property "message" of every commit in array "commits" and parse it. They are pretty tipical: "Merge branch 'some-branch' into Tests".
There are two problems
- Message theoretically could be modified by user (for example SourceTree shows you editor after conflict resolve)
- In case of Fast-Forward there is no message
What could you advise, how can I detect fact of merge and the name of merged branch better?
Thanks!