Skip to main content

fail

fail fails the promotion.

Configuration

NameTypeRequiredDescription
messagestringNOptional message to fail with

Examples

Common Usage

It may be necessary to fail a promotion if certain conditions are met. This can be done by combining this step with conditional step execution.

In this example, a HTTP request fetches an expected chart name from an external API. If it does not match the chart name from the Freight, the promotion fails with a message indicating the mismatch.

steps:
- uses: http
as: expected-name
config:
url: https://api.example.com/expected-name
outputs:
- name: name
fromExpression: response.body.name
- uses: fail
if: ${{ task.outputs['expected-name'].name != chartFrom('oci://example.com/my-chart').Name }}
config:
message: Expected chart name ${{ task.outputs['expected-name'].name }}