Add background audits of the default branch's newest commit
This commit is contained in:
@@ -63,7 +63,7 @@ func (s *Server) PutWorkflow(w http.ResponseWriter, r *http.Request, name string
|
||||
}
|
||||
|
||||
func (s *Server) SetReviewWorkflow(w http.ResponseWriter, r *http.Request, projectID string) {
|
||||
req := api.ReviewWorkflow{}
|
||||
req := api.ProjectWorkflow{}
|
||||
if !readJSON(w, r, &req) {
|
||||
return
|
||||
}
|
||||
@@ -75,6 +75,19 @@ func (s *Server) SetReviewWorkflow(w http.ResponseWriter, r *http.Request, proje
|
||||
writeJSON(w, http.StatusOK, p)
|
||||
}
|
||||
|
||||
func (s *Server) SetAuditWorkflow(w http.ResponseWriter, r *http.Request, projectID string) {
|
||||
req := api.ProjectWorkflow{}
|
||||
if !readJSON(w, r, &req) {
|
||||
return
|
||||
}
|
||||
p, err := s.agents.SetAuditWorkflow(r.Context(), projectID, req.Workflow, actor(r))
|
||||
if err != nil {
|
||||
writeAgentError(w, err)
|
||||
return
|
||||
}
|
||||
writeJSON(w, http.StatusOK, p)
|
||||
}
|
||||
|
||||
func (s *Server) DeleteWorkflow(w http.ResponseWriter, r *http.Request, name string) {
|
||||
err := s.store.DeleteWorkflow(r.Context(), name, actor(r))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user