We have a job within a pipeline that we only need to run if certain files/paths have changed, but in the case of a merge request pipeline we want the job to run if those files/paths have changed in the whole merge request (i.e. the same set of files you see in the tree on the Merge Request’s Changes tab), not just the last commit.
Using only:changes
we observe the following behaviour (for a merge request):
- Commit a change to one of the files in
only:changes
and the job fails (MR cannot be merged) - Now commit a change to a different file (outside of
only:changes
) and the job is not included, therefore the pipeline passes and the MR can be merged - master pipeline build includes the job as the file did change in the merge commit and it breaks
Is is possible? I saw rules:changes
but that seems to be saying its only for branch pipelines or merge request pipelines… however we do want our job to run for master commits also… plus I didn’t see how to explicitly make it apply to the whole set of MR changes each time the pipeline runs for the MR.