How to make job always appear in a merge request, but only when files change otherwise

I have a job I would like to appear in every merge request if one path has changed, but only appear in other pipelines if some other set of paths have changed.

Is this possible via the new rules:if CI commands?


Yes, this should be possible.

As an aside, here’s the “old” way of running a job if changes occur in a subdirectory:

To splice together, check out:


First link shows the logic; the second shows if branch = “master” or whatever the MR has as the protected branch.

Hope this helps!