webhook should be on POST
This commit is contained in:
parent
195fdb2bc7
commit
1bd84ee397
7
main.py
7
main.py
|
@ -1,6 +1,7 @@
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from git import Repo
|
||||||
from starlette.staticfiles import StaticFiles
|
from starlette.staticfiles import StaticFiles
|
||||||
from starlette.responses import FileResponse
|
from starlette.responses import FileResponse
|
||||||
from fastapi import FastAPI, Form
|
from fastapi import FastAPI, Form
|
||||||
|
@ -39,7 +40,9 @@ def query_get(q='*', s:int=0, i=None):
|
||||||
log.error(e)
|
log.error(e)
|
||||||
|
|
||||||
|
|
||||||
@app.post('/api/webhook')
|
@app.push('/api/webhook')
|
||||||
def on_git_push():
|
def on_git_push():
|
||||||
log.info('Executing webhook for Gitea')
|
log.info('Executing webhook for Gitea')
|
||||||
return 'executed'
|
repo = Repo()
|
||||||
|
repo.remotes.origin.pull()
|
||||||
|
return 200
|
Loading…
Reference in New Issue