Context & documentation
Version: GitLab Community Edition 13.5.3
Documentation: https://docs.gitlab.com/ee/ci/yaml/#ruleschanges
Use Case
There is a specific folder that does not need to be tested in our project, so I would like to pen the following
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- irrelevant_stuff/**/*
when: manual
This works partially
It does have the effect of making the pipeline job manual when things in irrelevant_stuff
is touched, but the problem is that if I touch something in the nearby folder relevant_stuff
which does need to be tested, it still comes up as manual.
Is there a way to make this a strict match pattern?
Is there a way to convey “anything but this folder” so I can put a rule above it saying anything but this folder -> always run
?
For those who may want to say I can pattern match relevant_stuff
, let’s assume there’s too many directories of different depths that are relevant, e.g.
- relevant_stuff/
- app/src/relevant_stuff/
- more_relevant_stuff
- other_relevant_stuff
- STUFF_RELEV
- our_stuff_needs_test
So matching all of these would blow up my YML and also mean the first moment that someone adds new_relevant_stuff
that it would be a manual job again.
Thanks for any thoughts!