TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Pull Requests

Last modified: 17 September 2020

The Pull Requests build feature lets you automatically load pull request (or merge requests in case of GitLab) information and run builds on pull request branches in GitHub, Bitbucket Server, GitLab, and (since version 2020.1) Azure DevOps.

The feature extends the original branch specification of the VCS roots, attached to the current build configuration, to include pull requests that match the specified filtering criteria. It monitors builds only on head branches:

  • For GitHub: refs/pull/*/head

  • For Bitbucket Server: refs/pull-requests/*/from

  • For GitLab: refs/merge-requests/*/head

  • For Azure DevOps: refs/pull/*/merge

In case with Azure DevOps, TeamCity detects requests on a merge branch. In other VCSs, it checks out the code from the source branch.

If you configure a VCS trigger for your build configuration, TeamCity will automatically run builds on changes detected in the monitored branches.

You can find the pull request's details displayed on the Overview tab of the Build Results:

Pull request details

When adding this build feature, you need to specify a VCS root and select a VCS hosting type.

The build feature parameters depend on the selected VCS hosting type.

See the example on how to set up TeamCity to run builds on pull requests.