Reputation: 1
I am checking on a solution where GITLAB CI job has to run only when merge-request is approved.
test_c: stage: test script: - echo "This job tests something. It will only run when all jobs in the" - echo "build stage are complete." rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
This works when the merge request is created but not when it is approved.
Upvotes: 0
Views: 151
Reputation: 1322
You could check the predefined variable
CI_MERGE_REQUEST_APPROVED
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_APPROVED == "true"
Upvotes: 1