* Potentially solved merge conflict

* Update pkg/model/planner.go

Based on feedback

Co-authored-by: Ryan (hackercat) <me@hackerc.at>

* Fixed compilation error

* added missed test

* Fixed spelling error to work with lint error

Co-authored-by: Ryan (hackercat) <me@hackerc.at>
Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Renstrom
2021-05-05 22:04:03 +02:00
committed by GitHub
parent 596e518fe9
commit aba4fec0ee
5 changed files with 87 additions and 6 deletions

View File

@@ -229,7 +229,7 @@ func (rc *RunContext) newStepExecutor(step *model.Step) common.Executor {
Success: true,
Outputs: make(map[string]string),
}
runStep, err := rc.EvalBool(sc.Step.If)
runStep, err := rc.EvalBool(sc.Step.If.Value)
if err != nil {
common.Logger(ctx).Errorf(" \u274C Error in if: expression - %s", sc.Step)
@@ -243,7 +243,7 @@ func (rc *RunContext) newStepExecutor(step *model.Step) common.Executor {
}
if !runStep {
log.Debugf("Skipping step '%s' due to '%s'", sc.Step.String(), sc.Step.If)
log.Debugf("Skipping step '%s' due to '%s'", sc.Step.String(), sc.Step.If.Value)
return nil
}
@@ -298,13 +298,13 @@ func (rc *RunContext) platformImage() string {
func (rc *RunContext) isEnabled(ctx context.Context) bool {
job := rc.Run.Job()
l := common.Logger(ctx)
runJob, err := rc.EvalBool(job.If)
runJob, err := rc.EvalBool(job.If.Value)
if err != nil {
common.Logger(ctx).Errorf(" \u274C Error in if: expression - %s", job.Name)
return false
}
if !runJob {
l.Debugf("Skipping job '%s' due to '%s'", job.Name, job.If)
l.Debugf("Skipping job '%s' due to '%s'", job.Name, job.If.Value)
return false
}