Build not triggered on Merge Request Approval in Gitlab #2896
-
If you are looking for help, please confirm the following...
Which mobile framework are you using?iOS (Swift, Objective-C) Steps to reproduceI have set up webhooks to be triggered by updates on merge requests. Sample workflow: workflows:
approve_me:
name: MR Approval test
max_build_duration: 120
instance_type: mac_mini_m2
triggering:
events:
- pull_request
cancel_previous_builds: true
when:
condition: event.object_attributes.action == "approved"
scripts:
- name: "MR got approval"
script: echo "SUCCESS" Expected resultsOn MR approval workflow starts. Actual resultsWorkflow does not start, in "Recent deliveries" section there are delivery with text "Welcome to Codemagic! Your builds will be started on branch push". Build id (optional)No response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hello @evgeny-sureev,
The above pattern is set for the main branch but you can set similar patterns for any branch depending on your workflow. |
Beta Was this translation helpful? Give feedback.
-
Hello. I want to trigger build not after merging, but after approval of merge request. |
Beta Was this translation helpful? Give feedback.
Hello @evgeny-sureev,
An update here, the case is the same with Gitlab and Github, and checking in on this, Pull Request/Merge Request approval event isn't the event Codemagic recognizes at the moment, the same is the case for PR comment, PR close, RP review requested, etc. Only a limited number of webhooks events: for example: push to a branch, push of a tag, open a pull_request and a push to a pull_request are currently supported as mentioned here:
https://docs.codemagic.io/yaml-running-builds/starting-builds-automatically/#build-triggers