diff --git a/v2/internal/runner/processor.go b/v2/internal/runner/processor.go index 7abe3920..31136ed3 100644 --- a/v2/internal/runner/processor.go +++ b/v2/internal/runner/processor.go @@ -25,9 +25,8 @@ func (r *Runner) processTemplateWithList(template *templates.Template) bool { match, err := template.Executer.Execute(URL) if err != nil { gologger.Warning().Msgf("[%s] Could not execute step: %s\n", r.colorizer.BrightBlue(template.ID), err) - } else { - results.CAS(false, match) } + results.CAS(false, match) }(URL) return nil }) @@ -49,9 +48,8 @@ func (r *Runner) processWorkflowWithList(template *templates.Template) bool { match, err := template.RunWorkflow(URL) if err != nil { gologger.Warning().Msgf("[%s] Could not execute step: %s\n", r.colorizer.BrightBlue(template.ID), err) - } else { - results.CAS(false, match) } + results.CAS(false, match) }(URL) return nil }) diff --git a/v2/pkg/workflows/execute.go b/v2/pkg/workflows/execute.go index 30f2feec..9e74be30 100644 --- a/v2/pkg/workflows/execute.go +++ b/v2/pkg/workflows/execute.go @@ -9,7 +9,7 @@ func (w *Workflow) RunWorkflow(input string) (bool, error) { for _, template := range w.Workflows { err := w.runWorkflowStep(template, input, results) if err != nil { - return false, err + return results.Load(), err } } return results.Load(), nil @@ -26,8 +26,10 @@ func (w *Workflow) runWorkflowStep(template *WorkflowTemplate, input string, res if err != nil { return err } - firstMatched = matched - results.CAS(false, matched) + if matched { + firstMatched = matched + results.CAS(false, matched) + } } if len(template.Matchers) > 0 {