I`m new to Gitlab-CI and would like to trigger a script in Gitlab CI if changes are made to files in a defined folder and there has either been a push to the master branch OR some other branch has been merged into master. After reading the docs I think this could work:
trigger_something:
rules:
- changes:
- path2importantstuff/*
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "master"'
script:
- curl --data-urlencode "argString=-ExecutionMode 'Real Run'" 127.0.0.1:2220/api/11/job/47c7c848/run
Is it possible to combine if conditions like this? Are they combined with a logical OR? Can something be improved?
Thank you - all the best, Sacha