autogits/pr-review/main.go
2024-07-09 12:06:24 +02:00

37 lines
665 B
Go

package main
import (
"src.opensuse.org/autogits/common"
)
const (
ListenPort = 8001
ListenAddr = "[::1]"
GitAuthor = "GiteaBot - AutoStaging"
PrReview = "pr-review"
)
func processPullRequest(h *common.RequestHandler) error {
req := h.Data.(common.PullRequestAction)
// requests against project are not handled here
if req.Repository.Name == common.DefaultGitPrj {
return nil
}
return nil
}
func main() {
var defs common.ListenDefinitions
defs.Url = PrReview
defs.GitAuthor = GitAuthor
defs.Handlers[common.RequestType_PR] = processPullRequest
common.RequireGiteaSecretToken()
common.RequireObsSecretToken()
common.StartServer(defs)
}