Skip to content

Commit

Permalink
Add ability to skip tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Veld committed Aug 4, 2023
1 parent 02d159e commit c65c1de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/config/resources/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Validation struct {
type ValidationCondition struct {
ID string `json:"id"`
Check string `json:"check"`
Solve string `json:"solve,omitempty"`
Solve string `json:"solve"`
FailureMessage string `json:"failure_message"`
SuccessMessage string `json:"success_message,omitempty"`
Target string `json:"target,omitempty"`
Expand Down
10 changes: 10 additions & 0 deletions pkg/server/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ func (a *API) validation(w http.ResponseWriter, r *http.Request) {
}
}

if script == "" {
w.WriteHeader(http.StatusOK)
json.NewEncoder(w).Encode(ValidationResponse{
Task: req.Task,
Condition: req.Condition,
ExitCode: 0,
})
return
}

dc, err := clients.NewDocker()
if err != nil {
a.log.Error("Could not create docker client", "error", err.Error())
Expand Down

0 comments on commit c65c1de

Please sign in to comment.