mirror of
https://github.com/techknowlogick/faas-lgtmbot
synced 2024-11-22 06:52:00 +01:00
return on error
This commit is contained in:
parent
ac7decb6a4
commit
cc9ec6c4d5
@ -1,11 +1,11 @@
|
||||
package function
|
||||
|
||||
import (
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
scm "github.com/jenkins-x/go-scm/scm"
|
||||
giteaWebhook "github.com/jenkins-x/go-scm/scm/driver/gitea"
|
||||
)
|
||||
@ -50,11 +50,13 @@ func Handle(w http.ResponseWriter, r *http.Request) {
|
||||
if err != nil {
|
||||
// failed to get secret
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
giteaClient, err := gitea.NewClient(string(giteaHost), gitea.SetToken(string(giteaToken)))
|
||||
if err != nil {
|
||||
// failed to setup gitea client
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
// fetch PR and approvals
|
||||
|
Loading…
Reference in New Issue
Block a user