"only: changes" between refs

Hi guys,

I’m working on a project where I could successfully setup my .gitlab-ci.yaml to only run certain jobs when there are changes to relevant paths when it’s in the same branch.

However, what’s annoying is that this doesn’t work between different branches and, more importantly, in tags. So, for example, in this project I have several test and check jobs that get run even on tags - to ensure that these tags are safe according to those jobs -, but I’d like to make it so that tags can benefit from the cached results for changes on master - so that, if master already ran those jobs successfully, the tag doesn’t run them again, but if the tag is pushed before master is pushed with those changes, then the tag runs them as well.

In other words, the basis of the problem I’m having is that the “cache” for path changes is not persisting between different git refs; If there’s a way to overcome this issue, it would be really nice.

Thanks for any help, in advance!

Cheers,
Diogo