Home:ALL Converter>GitLab CI/CD : detect when a merge request is reverted

GitLab CI/CD : detect when a merge request is reverted

Ask Time:2021-04-28T16:26:56         Author:Arthur Eudeline

Json Formatter

Is there any way to run a pipeline when a merge request is reverted on GitLab CI/CD? I tried to debug environment variables with those two jobs but they are not triggered :

stages:
  - test

debug:
  stage: test
  script:
    - printenv
  when: always

debug2:
  stage: test
  script:
    - printenv
  rules:
    # Run only during merge requests
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
      when: always
      allow_failure: false

I would like to roll back a deployment made with PHP Deployer over SSH when a merge request on a deployment branch is reverted

Author:Arthur Eudeline,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/67296535/gitlab-ci-cd-detect-when-a-merge-request-is-reverted
yy