Last active
December 28, 2015 11:09
-
-
Save PuercoPop/7491302 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import subprocess | |
from flask import Flask, request | |
PROJECT_ROOT = "" | |
app = Flask(__name__) | |
@app.route('/', methods=['POST']) | |
def pull(): | |
"""Verify that the request is from Github, then do a pull request | |
interactive. | |
""" | |
if request.headers.get('X-Github-Event') == "push": | |
process = subprocess.Popen(['git', 'pull', '--rebase', 'origin', 'master'], | |
cwd=PROJECT_ROOT, ) | |
else: | |
print "Empty Payload" | |
if __name__ == "__main__": | |
app.run("0.0.0.0", 7373) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment