orphans / git-deploy-laravel

Helps automate the deployment of projects onto servers by utilising Git's web hooks.
MIT License
34 stars 14 forks source link

Empty postdata when deploying from github #14

Closed sigrtmax closed 5 years ago

sigrtmax commented 5 years ago

In file vendor/orphans/git-deploy-laravel/src/http/GitDeployController.php line 46 should be $postdata = json_decode($request->get('payload'), TRUE); if you are using github Tested via laravel 5.7

Muffinman commented 5 years ago

Hi @alapaev,

Thanks for the report, I believe we followed the specs for GitHub payloads as per this page. As far as I know this is tested and working?

Your suggestion assumes that the data is sent in a GET/POST variable called payload, can you give me an example webhook request payload where this change works for you?

sigrtmax commented 5 years ago

Sure, example on screenshot https://i.imgur.com/zrWYiAn.png

sigrtmax commented 5 years ago

With present version of code webhook gets this json from my webserver {"success":false,"message":"Web hook data does not look valid"}

Muffinman commented 5 years ago

Ah, I think you might be sending with the wrong content type.

It should be sent with application/json rather than application/x-www-form-urlencoded. I'll have to add a note about this in the docs.

Muffinman commented 5 years ago

Example page from Github webhook setup:

screen shot 2019-02-05 at 22 52 21

sigrtmax commented 5 years ago

Thanks a lot! I've missed this input in form