How to make a MR automatically merge when an external pipeline is finished?

Hi there,

I have integrated with Spacelift’s an external system that handles terraform via webhook. So when I create a MR, any changes to my MR triggers the webhook to Spacelift which runs some external job,

Now there are 2 external job phase in which Spacelift will trigger, but only the 2nd job is manual and when the 2nd job is completed then I would like to merge the MR.

The problem is if I click in merge when pipeline is completed that will not work because inorder for the 2nd job to be triggered, it is manual at Spacelift’s end. This mean, when the 1st job is completed, that will merge upon the 1st job not the 2nd job,

What I had tried

  • I tried to create .gitlab-ci which does not trigger the external jobs

How do I achieve an automatic merge on the case above?