How to handle a GitHub webhook POST request?

First, you seem to misunderstand how PHP handles incoming POST request. It only exists in that instance webhook is making request. If you load that page in a browser there won’t be any POST data, unless you are submitting some.

To properly check that request was received you should log results from that file and check the file before and after webhook ping.

Second, you are not quite doing this “in” WordPress yet. Creating your own PHP files as endpoints in WP installation is problematic technique which is rarely used.

If you do want to properly integrate this within WP installation you should be using appropriate native endpoint and WP APIs to handle it. For POST requests one sematically fitting option would be wp-admin/admin-post.php. Though if you can’t customize remote payload (set action parameter) and use fitting hooks you will have to do your own check for context.