<p><a href="https://docs.gitlab.com/ee/ci/yaml/" rel="nofollow noreferrer">https://docs.gitlab.com/ee/ci/yaml/</a></p>

<p><a href="https://gitlab.com/gitlab-org/gitlab-ce/issues/31296#note_34944784" rel="nofollow noreferrer">https://gitlab.com/gitlab-org/gitlab-ce/issues/31296#note_34944784</a></p>

<blockquote>
<pre><code>integration-testing:
  stage: test
  only:
    - master
  script:
    - ./gradlew clean build asciidoctor
</code></pre>
</blockquote>

<p>Another option is to create a webhook</p>

<p><a href="https://gitlab.scm.webanywhere.co.uk/help/user/project/integrations/webhooks.md" rel="nofollow noreferrer">https://gitlab.scm.webanywhere.co.uk/help/user/project/integrations/webhooks.md</a></p>

<p>If the "Merge request events" is clicked one could trigger a pipeline if a Pull Request gets updated, created or merged.</p>

CC BY-SA 4.0
2019-07-18T02:48:41.710Z
Thanks for the response.
I am aware of `only  - master `, but this will gonna trigger pipeline even if some creates a merge request too,
I want to trigger the pipeline once the merge request is accepted and I don't wanna use hooks for this task.
Randeep tomar
CC BY-SA 4.0
2019-07-17T18:53:47.113Z
2019-07-17T19:03:55.523Z
2019-07-17T19:03:55.523Z
030
<p>More options like this.</p>
<pre><code>integration-testing:
  stage: test
  only:
    refs:
      - master
      - /release-.+/
</code></pre>
<p>Complete documentation can be found at <a href="https://docs.gitlab.com/ee/ci/yaml/#onlyexcept-advanced" rel="nofollow noreferrer">gitlab doc</a></p>

CC BY-SA 4.0
2020-08-11T04:13:11.830Z
2020-08-11T04:13:11.830Z
Estu Fardani
<p>Trying to run some task after merge request get accept (only on master branch).
I am aware of <code>only: - master -merge_requests</code> config options, but want to specifically run pipeline only when code get merged in master.</p>

<gitlab><gitlab-ci-runner>
Trigger cicd pipeline after merge request accept on master, Gitlab
Randeep tomar
# Trigger cicd pipeline after merge request accept on master, Gitlab

(Asked by: username_0 on 2019-07-16)

Trying to run some task after merge request get accept (only on master branch).
I am aware of `only: - master -merge_requests` config options, but want to specifically run pipeline only when code get merged in master.

**Tags:** gitlab, gitlab-ci-runner


---

## 2 answers

### Answer by username_1 on 2019-07-17. Score: 1

https://docs.gitlab.com/ee/ci/yaml/
https://gitlab.com/gitlab-org/gitlab-ce/issues/31296#note_34944784

integration-testing:
  stage: test
  only:
    - master
  script:
    - ./gradlew clean build asciidoctor


Another option is to create a webhook
https://gitlab.scm.webanywhere.co.uk/help/user/project/integrations/webhooks.md
If the "Merge request events" is clicked one could trigger a pipeline if a Pull Request gets updated, created or merged.

> **Comments:**
> **username_0**: Thanks for the response. I am aware of `only  - master `, but this will gonna trigger pipeline even if some creates a merge request too, I want to trigger the pipeline once the merge request is accepted and I don't wanna use hooks for this task.  

---

### Answer by username_2 on 2020-08-11. Score: 0

More options like this.
integration-testing:
  stage: test
  only:
    refs:
      - master
      - /release-.+/

Complete documentation can be found at gitlab doc


---

