In Gitlab CI rules, Gitlab check if one of the rules is present then he choose to add the job or not. I am looking to check all the conditions and if they're all OK he can add the job, otherwise he must no add it to the pipeline:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
- changes:
- filder1/*.xml
In this example i try to tell gitlab to add the job only if some xml files had changed and there is a merge request to be merged the main branch.