Skip to content

Instantly share code, notes, and snippets.

@Greg-Boggs
Created April 9, 2020 02:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Greg-Boggs/f628b4a76bab0b00625db3f5f53d9e11 to your computer and use it in GitHub Desktop.
Save Greg-Boggs/f628b4a76bab0b00625db3f5f53d9e11 to your computer and use it in GitHub Desktop.
Example webhook
<?php
try {
$payload = json_decode($_REQUEST['payload']);
if ($payload->ref === 'refs/heads/master') {
$output = array();
// Pull Data
exec('cd /var/www && /usr/bin/git pull', $output);
print($output[0]);
}
}
catch(Exception $e) {
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment