do you try to create a pipeline template which is to be included by several projects? Then I would define it as template and let the including project extend the job when these files exist.
or does this condition exist in some branches of one project but not in others? Then maybe abuse something like the branch name and match that one with pattern.
Unfortunately ANDing “exists” or “changes” is not possible at the moment.
Regarding “changes” keep in mind that jobs might not be triggered if you push multiple commits to a branch and only the first one changed the file actually (I use forced pushed for some usecases).
Common sense makes me believe that the cases of existence/change of the file are not covered fully, and while in the case of change check the most common case is covered (any change in the files from the list causes job execution), in case of file existence is the least common scenario is covered. If I’m checking the existence of files to trigger the job, I’m expecting that all of them are there. The cleanest solution in my opinion should be 2 options: exists_any: [list] and exists_all: [list] changed_any: [list] and changed_all: [list]
BTW, the option to check all files existing is highly missing.
I agree about calling this a “design misfortune”. To me, the cleanest solution would probably be to not try to handle cases like this with new predicate keywords like exists_any or exists_all (what would you do if you wanted to run only if (X AND Y) OR Z exists?), but by creating predicate functions that could function with arbitrary boolean combinations, like so (presuming the existence of a new exists() predicate function):