# Trigger: build only if a merge into master is detected

**URL:** https://www.finalbuilder.com/forums/t/trigger-build-only-if-a-merge-into-master-is-detected/6920
**Category:** Discussion
**Created:** [November 12, 2020, 8:02am UTC](https://www.finalbuilder.com/forums/t/trigger-build-only-if-a-merge-into-master-is-detected/6920 "2020-11-12T08:02:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mjustin\_de](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/m/e19b73/32.png) [@mjustin\_de](https://www.finalbuilder.com/forums/u/mjustin_de)
#### Post date: [November 12, 2020, 8:02am UTC](https://www.finalbuilder.com/forums/t/trigger-build-only-if-a-merge-into-master-is-detected/6920/1 "2020-11-12T08:02:49Z")

</div>

Dear forum,

in the trigger configuration we use a quiet period of “0”, so a build is triggered for every commit. We would like to run only one build per merge commit (from feature branch to master). Currently, if a merge contains many commits, we get many pending builds - one per commit, which is more than needed.

There is a “comment pattern” input field in the trigger configuration options. If the build is triggered only when a merge commit message contains the word “merge”, this should help reduce the number of builds. Is this correct?

Kind regards  
Michael

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [November 12, 2020, 9:01am UTC](https://www.finalbuilder.com/forums/t/trigger-build-only-if-a-merge-into-master-is-detected/6920/2 "2020-11-12T09:01:52Z")

</div>

Hi Michael,

> [@mjustin\_de](#):
>
> Currently, if a merge contains many commits, we get many pending builds - one per commit, which is more than needed.

Assuming this is a git repository, there is an option on the `Branch` tab of the trigger dialog labelled “Skip commits previously built for this configuration”. This prevents a more that one build triggering for the changesets with the same commit hash on different branches. Does this work for your scenario?

> [@mjustin\_de](#):
>
> There is a “comment pattern” input field in the trigger configuration options. If the build is triggered only when a merge commit message contains the word “merge”, this should help reduce the number of builds. Is this correct?

Yes, if you enter the word “merge” into the `Include` field on the `Comments` tab of the trigger dialog, then a build is only triggered if the commit message contains the word “merge”.
