Skip to content

on_failure Step Hook

on_failure: step

A hook step to execute if the parent step fails.

This does not "recover" the failure - it will still fail even if the hook step succeeds.


Alerting on failure

The following will perform the alert task only if the unit task fails:

plan:
  - get: foo
  - task: unit
    file: foo/unit.yml
    on_failure:
      task: alert
      file: foo/alert.yml