这个例子不起作用。我只想在合并请求和 uat 分支时触发管道....
stage: build
script:
- echo "script"
only:
- uat
- merge_requests```
答案 0 :(得分:0)
您可以在此处使用规则(请参阅 https://docs.gitlab.com/ee/ci/yaml/#rules):
stage: build
script:
- echo "script"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == "uat"'