feat: update logs
This commit is contained in:
parent
eaf0b1ff69
commit
f6e4e64e81
4
main.go
4
main.go
|
@ -27,8 +27,8 @@ func main() {
|
|||
if err != nil {
|
||||
log.Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
log.Println("GOOO")
|
||||
http.HandleFunc("/", handlePayload(cfg.Secret, cfg.Projects))
|
||||
log.Printf("server is up on %d\n", cfg.Port)
|
||||
http.ListenAndServe(fmt.Sprintf(":%d", cfg.Port), nil)
|
||||
}
|
||||
|
||||
|
@ -57,6 +57,7 @@ func handlePayload(secret string, projects map[string][]config.ConfigScript) fun
|
|||
proj, found := projects[project]
|
||||
if !found {
|
||||
http.Error(w, "not found", http.StatusNotFound)
|
||||
log.Printf("project %s not found\n", project)
|
||||
return
|
||||
}
|
||||
var payload internal.WebhookPayload
|
||||
|
@ -77,6 +78,7 @@ func handlePayload(secret string, projects map[string][]config.ConfigScript) fun
|
|||
}
|
||||
if !found {
|
||||
http.Error(w, "not found", http.StatusNotFound)
|
||||
log.Printf("project %s with branch %s not found\n", project, branchName)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue