Skip to content

Instantly share code, notes, and snippets.

@Eworm
Created February 26, 2018 13:46
<?php
// Use in the "Post-Receive URLs" section of your GitHub repo.
if ( $_POST['payload'] ) {
$data = json_decode($_POST['payload']);
if ($data->ref == 'refs/heads/master') {
shell_exec( 'cd /home/YOURNAME/webapps/WEBAPPNAME && git pull' );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment