This commit is contained in:
Adam Majer 2024-07-10 17:29:36 +02:00
parent 96a07e95c7
commit ef6fd8ee20
2 changed files with 6 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import (
const RequestType_Push = "push"
const RequestType_Repository = "repository"
const RequestType_PR = "pull_request"
const RequestType_PR_sync = "pull_request_sync"
type RequestProcessor func(*RequestHandler) error
@ -56,6 +57,8 @@ func StartServerWithAddress(listenDefs ListenDefinitions, addr string) {
h.parsePushRequest(req.Body)
case RequestType_PR:
h.parsePullRequest(req.Body)
case RequestType_PR_sync:
h.parsePullRequestSync(req.Body)
default:
h.LogError("Unhandled request type: %s", reqType)
res.WriteHeader(http.StatusInternalServerError)

View File

@ -99,6 +99,7 @@ func main() {
defs.Handlers = make(map[string]common.RequestProcessor)
defs.Handlers[common.RequestType_PR] = processPullRequest
defs.Handlers[common.RequestType_PR_sync] = processPullRequest
common.RequireGiteaSecretToken()
common.RequireObsSecretToken()