webhook should be on POST

This commit is contained in:
Andrea Mannocci 2020-07-07 18:32:36 +02:00
parent 195fdb2bc7
commit 1bd84ee397
2 changed files with 5 additions and 2 deletions

0
foo
View File

View File

@ -1,6 +1,7 @@
import logging
import os
import sys
from git import Repo
from starlette.staticfiles import StaticFiles
from starlette.responses import FileResponse
from fastapi import FastAPI, Form
@ -39,7 +40,9 @@ def query_get(q='*', s:int=0, i=None):
log.error(e)
@app.post('/api/webhook')
@app.push('/api/webhook')
def on_git_push():
log.info('Executing webhook for Gitea')
return 'executed'
repo = Repo()
repo.remotes.origin.pull()
return 200