Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab CI when never

I saw this code on one of the pipelines of my company.

rules:
- if: 'SOME-CONDITION'
  when: manual
- when: never
variables:
...

According to gitlab ci documentation, the when:never field should be used with a condition, to basically tell the pipeline to not add the job if that condition is satisfied. I don't understand its use by itself in the end of the rules. What does it add and how the pipeline will behave without it ?

like image 397
joe1531 Avatar asked Jul 29 '26 09:07

joe1531


1 Answers

I think that at the end of the rules block the line when: never tells that the pipeline should not be run in any other cases. Because by default it runs after each commit in any created MR.

like image 90
Loremo Avatar answered Aug 01 '26 20:08

Loremo