Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab CI: Fail pipeline if variable not set?

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.

like image 636
Doctor Who Avatar asked Apr 08 '26 12:04

Doctor Who


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

like image 76
mochsner Avatar answered Apr 10 '26 08:04

mochsner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!