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.
You could check the predefined variable
CI_MERGE_REQUEST_APPROVED