Gitlab CI: Fail pipeline if variable not set?

Viewed 6040

Is there a way fail my entire pipeline if the user triggered the pipeline and didn't set a variable called options with a value?

I've tried things like only and rules but they just skip the job instead of failing all jobs.

1 Answers

Yes, though the way you fail would be dependent on the system your runner's based on.

For example, in a Linux/bash based runner, all you need is exit 1 (as opposed to exit 0) to stop execution and fail the pipeline

Related