Port GH-1460: improve GitHub hook support

* accept `application/json` format
* accept `ping` event

Port of GH-1460