How to get gitlab ci variables when merge request is merged?

Viewed 213

I wish to get $CI_MERGE_REQUEST_TITLE and $CI_MERGE_REQUEST_PROJECT_URL when merge request is merged, however i got two empty string. I've checked the doc of gitlab and got this:

enter image description here

So is there any other way to get the information i need after merge request is merged? Thanks for any comment!

1 Answers

"when merge request is merged"

That looks like a merge result pipeline, one of the three type of merge requests pipelines. It runs on the result of combining the source branch’s changes with the target branch.

But:

  • it is only for Premium GitLab
  • it needs to be activated ("Enable merged results pipelines.")
Related