Skip to content

Commit

Permalink
github webhook update
Browse files Browse the repository at this point in the history
  • Loading branch information
Light-Beacon committed Feb 21, 2024
1 parent f997bae commit a386174
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Server/project_updater.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GIT_PULL = 'git pull -f'

class GithubAuthError(Exception):
pass

def __update(request,project_path):
if not vaild_from_github(request):
raise GithubAuthError('Auth Failed')
result = subprocess.check_output(GIT_PULL,cwd = project_path, shell=True)
return result

def request_update(request,project_path):
try:
return (True,__update(request,project_path))
except Exception as e:
return (False,e.args)

0 comments on commit a386174

Please sign in to comment.