Skip to content

Commit

Permalink
move if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshMcCullough committed May 21, 2023
1 parent 7d005c1 commit 921167b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/runner/run_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,17 +535,17 @@ func (rc *RunContext) isEnabled(ctx context.Context) (bool, error) {
return false, fmt.Errorf(" \u274C Error in if-expression: \"if: %s\" (%s)", job.If.Value, runJobErr)
}

if !runJob {
l.WithField("jobResult", "skipped").Debugf("Skipping job '%s' due to '%s'", job.Name, job.If.Value)
return false, nil
}

if jobType == model.JobTypeInvalid {
return false, jobTypeErr
} else if jobType != model.JobTypeDefault {
return true, nil
}

if !runJob {
l.WithField("jobResult", "skipped").Debugf("Skipping job '%s' due to '%s'", job.Name, job.If.Value)
return false, nil
}

img := rc.platformImage(ctx)
if img == "" {
if job.RunsOn() == nil {
Expand Down

0 comments on commit 921167b

Please sign in to comment.