I would like to be able to configure a Gitlab CI job so that it fails if certain keywords are in that job’s log.
I’m wondering if this is an existing feature that I just can’t find, or if it is not a feature of Gitlab CI.
My use case is that bash scripts can’t sometimes have command not found errors without making the pipeline fail, because the error happens inside an if condition/test. Thus, I want to the pipeline to fail if the job log has any command not found messages.
This feature would have much broader usage as well, you could configure it to recognize error messages from your program or testing frameworks.
Hi, I don’t understand how this solves my problem. Grep fails if it doesn’t find a match, and you’ve specified -v, so it is looking for stuff without “command not found”. However, my log will always have other lines, so grep will always find things and never error? Sorry if I didn’t make it clear that the log has other stuff in it.