Webhook get commit branch

Hi,

I’ve setup a webhook to call a specific url when a commit occurs however it doesn’t give any information as to which branch is being commited, “master” or “dev”.

Is there any way I can get this information from a webhook?

How do I get the payload (PHP or Node)? I don’t care what was commited only what branch was commited so that I can make a request to my dev or live servers to do a git pull and execute update.sh

All I get from the webhook is:

{
"REQUEST_METHOD":"GET",
"CONTENT_TYPE":"application\/json",
"headers":{
"Content-Type":"application\/json",
"X-Hub-Signature-256":"sha256=xxxx",
"X-Hub-Signature":"sha1=xxx",
"X-Github-Hook-Installation-Target-Type":"repository",
"X-Github-Hook-Installation-Target-Id":"xxx",
"X-Github-Hook-Id":"xxx",
"X-Github-Event":"push",
"X-Github-Delivery":"xxx",
"Referer":"webhook url called",
"Accept":"*\/*",
"User-Agent":"GitHub-Hookshot\/8338482",
"Connection":"close",
"X-Accel-Internal":"\/internal-nginx-static-location",
"X-Real-Ip":"xxx",
"Host":"xxxx"
},
"JSON":"",
"POST":[],
"GET":[],
"payload":null
},

I make a call to:

https://api.github.com/repos/:owner/:repo/hooks/:hook_id

But just returns

{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/reference/repos#get-a-repository-webhook"
}

Thanks

D