How to stop TeamCity from building a pull request when it is viewed or commented?

github, teamcity

Solution

Do you have TeamCity configured as per this blog post? I then activate the TeamCity service hook in GitHub which takes care of triggering a build in TeamCity whenever there is a push. This seems to do the right thing for me. Or am I missing something?

Problem

Currently, my team is using TeamCity to automatically build pull requests from GitHub. We have a configuration to build all the pull requests. In the version control settings of the config, our branch specification is ``` +:refs/pull/*/merge ``` In the "Build Triggers" configuration setting, we have only one trigger with the following trigger rule: ``` +:root=Pull Requests on our Repository:\***/*\* ``` "Pull Requests on our Repository" is our VCS root name. The issues: - When someone views a pull request on GitHub website without doing anything else, a build would be triggered in the TeamCity build agent. This is quite annoying, because from time to time, we have multiple build agents building the same pull requests (when multiple people view it). - When someone comments on a pull request, a build would also be triggered. From my perspective, the only time I want TeamCity to start a build is when new commits are pushed to the pull requests. Is there a way to do it?

Original source