Execute Different script after Merge Request is merged or closed

Hi support team

I am trying to execute different bash scripts when a MR is merged or closed.
For now I am using the Gitlab environment:on_stop which matching most of my requirement, but it seems on_stop treat merged and closed as same thing.

Is there any why I could differentiate these two thing at on_stop job? or any global variable I could use?



Hi @jetlee

this is not a support forum, but community forum. If you need help from GitLab support you need to create support case on support.gitlab.com.

There is currently no difference between merging or closing the MR. I haven’t tried it but you might be able to get MR state from GitLab API and execute correct script based on that (in a single job).