Answers: <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>
  
Answers: CC BY-SA 4.0
Answers: 2019-07-18T02:48:41.710Z
Answers: 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.
Answers: Randeep tomar
Answers: CC BY-SA 4.0
Answers: 2019-07-17T18:53:47.113Z
Answers: 2019-07-17T19:03:55.523Z
Answers: 2019-07-17T19:03:55.523Z
Answers: 030
Answers: <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>
  
Answers: CC BY-SA 4.0
Answers: 2020-08-11T04:13:11.830Z
Answers: 2020-08-11T04:13:11.830Z
Answers: Estu Fardani
Body: <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>
  
Tags: <gitlab><gitlab-ci-runner>
Title: Trigger cicd pipeline after merge request accept on master, Gitlab
UserDisplayName: Randeep tomar
ThreadText: # 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](https://docs.gitlab.com/ee/ci/yaml/#onlyexcept-advanced)
  
  
  ---
  
  