Created
April 9, 2020 02:30
-
-
Save Greg-Boggs/f628b4a76bab0b00625db3f5f53d9e11 to your computer and use it in GitHub Desktop.
Example webhook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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