.
This commit is contained in:
parent
96a07e95c7
commit
ef6fd8ee20
@ -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)
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user