1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-11-23 21:44:44 +02:00

Add option to ignore failures on steps (#1219)

closes #1181
closes #834 

Adds `ignore_failure` to pipeline steps. When it's set to true,
if the step fails the following steps continue to execute as if no failure had occurred.

---

failure enums idea:
* fail (default) = if other steps run in parallel, wait for them and
then let workflow fail
* cancel = if other steps run in parallel, kill them
* ignore = we mark the step as failed but it wont have any impact
This commit is contained in:
Sergio Fenoll
2022-11-15 19:47:27 +01:00
committed by GitHub
parent de8ea95dd3
commit f0e518a5a2
7 changed files with 42 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import (
"golang.org/x/sync/errgroup"
backend "github.com/woodpecker-ci/woodpecker/pipeline/backend/types"
"github.com/woodpecker-ci/woodpecker/pipeline/frontend"
"github.com/woodpecker-ci/woodpecker/pipeline/multipart"
)
@@ -193,7 +194,11 @@ func (r *Runtime) execAll(steps []*backend.Step) <-chan error {
}
// Return the error after tracing it.
return r.traceStep(processState, err, step)
err = r.traceStep(processState, err, step)
if err != nil && step.Failure == frontend.FailureIgnore {
return nil
}
return err
})
}