Skip to content

Instantly share code, notes, and snippets.

@Demonstrandum
Last active June 3, 2017 13:51
Show Gist options
  • Save Demonstrandum/956413d7179732bedc7135a83204442c to your computer and use it in GitHub Desktop.
Save Demonstrandum/956413d7179732bedc7135a83204442c to your computer and use it in GitHub Desktop.
GitHub's webhooks for repositories, in PHP and sh.
<?php
header("Content-type: text/plain");
if ( $_POST['payload'] ) {
shell_exec("./pull");
}
?>
#!/bin/sh
git reset --hard HEAD
git pull origin master # Change names if different
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment