.gitlab-ci.yaml Conditional Includes

I’d like to conditionally include a file based on some criteria. I’m creating a shared pipeline definition and I’d like to define things and run things only if the project the pipeline it’s running is has specific variables set or if a file exists in the directory. For example, I have language specific yaml files, I’d like to

   - local: "languages/docker.yaml"
     when: exists(Dockerfile)

Or something along those lines; is there a way to do what I’m looking for?

1 Like

FYI - was able to get around this by using conditional logic in the included files themselves and scoping variables to job level.

This would be useful… Or just “only” the same way as for stages.