Commit 7848ce5c authored by Guilhem Saurel's avatar Guilhem Saurel

allow pull requests

parent 10dc2ab8
Pipeline #8478 passed with stage
in 52 seconds
......@@ -20,7 +20,6 @@ from rainboard.models import Forge, Namespace, Project
from . import models
def check_suite(request: HttpRequest, rep: str) -> HttpResponse:
"""Manage Github's check suites."""
data = loads(request.body.decode())
......@@ -28,6 +27,12 @@ def check_suite(request: HttpRequest, rep: str) -> HttpResponse:
return HttpResponse(rep)
def pull_request(request: HttpRequest, rep: str) -> HttpResponse:
"""Manage Github's Pull Requests."""
loads(request.body.decode())
return HttpResponse(rep)
def push(request: HttpRequest, rep: str) -> HttpResponse:
"""Someone pushed on github. Synchronise local repo & gitlab."""
data = loads(request.body.decode())
......@@ -121,5 +126,7 @@ def webhook(request: HttpRequest) -> HttpResponse:
return push(request, 'push event detected')
if event == 'check_suite':
return check_suite(request, 'check_suite event detected')
if event == 'pull_request':
return pull_request(request, 'check_suite event detected')
return HttpResponseForbidden('event not found')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment