Hi,
I am trying to add jobs to pipeline only when a specific file is changed in a commit to a feature branch. I am running a merge results pipeline with merge trains
But the rule on all different configs doesnt work:
It could be that an if statement is required. Try something like:
eu-west-1--prod-plan:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- if: $CI_COMMIT_BRANCH # change depending on when you want to run the job
changes:
- tfvars/**/eu-west-1-prod.*
@paula.kokic Thanks for the help - this fix did not help, for some reason every push to feature branch editing only specifc file, will trigger all the plan jobs in the pipeline.
I would suggest reviewing your paths and making sure the wildcards are set correctly. I’d also have to play around a bit, as I’m not really a master in this. Reference: CI/CD YAML syntax reference | GitLab