TeamCity 2019.1 Help

Pull Requests

The Pull Requests build feature lets you automatically load pull requests information and run builds on pull request branches of the following VCS hosting services:

The feature extends your original branch specification to include pull requests that match the specified filtering criteria.
After a build is run on a pull request, TeamCity provides additional details for the pull request branch on the build overview page.

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.

For requests from GitHub and GitLab, you can set up TeamCity to automatically run a build on each request and merge the request if the build is successful.
To achieve this, enable and configure the Pull Requests and Automatic Merge build features, and create a VCS trigger for your GitHub/GitLab VCS root.

GitHub Pull Requests

TeamCity supports GitHub and GitHub Enterprise.

The following parameters are available for the GitHub hosting type:

Parameter

Options

Description

Authentication Type

Use VCS root credentials

TeamCity will try to extract username/password credentials or a personal access token/x-oauth-basic from the VCS root settings if the VCS root uses HTTP(S) fetch URL.

For a GitHub Enterprise repository, only the personal access token/x-oauth-basic pair will work.

This option will not work if the VCS root employs anonymous authentication.

Access token

The 'Token' field appears.

Use a personal access token or obtain a token through an OAuth connection. It must have either the public_repo or repo scope scope depending on the repository type.

By authors

Members of the same organization

Only detects pull requests submitted by members of the same organization in GitHub.

Members and external collaborators

Only detects pull requests submitted by members of the same organization and external collaborators in GitHub.

Everybody

Detects all pull requests. Be aware that selecting this option may allow arbitrary users to execute malicious code on your build agents.

By target branch

Specify names of target branches. If left blank, no filters apply.

Server URL

Specify a GitHub URL for connection.

If left blank, the URL will be extracted from the VCS root fetch URL.

Bitbucket Server Pull Requests

The following parameters are available for the Bitbucket Server hosting type:

Parameter

Options

Description

Authentication Type

Use VCS root credentials

TeamCity will try to extract username/password credentials from the VCS root settings if the VCS root uses HTTP(S) fetch URL.

This option will not work if the VCS root employs anonymous authentication.

Username/password

The 'Username' and 'Password' fields appear.

Specify a username and password for connection to Bitbucket Server.

By target branch

Specify names of target branches. If left blank, no filters apply.

Server URL

Specify a Bitbucket URL for connection.

If left blank, the URL will be extracted from the VCS root fetch URL.

GitLab Merge Requests

TeamCity processes GitLab merge requests similarly to how it processes pull requests in other hosting services. Currently, TeamCity detects only merge requests submitted after this build feature is enabled.

The following parameters are available for the GitLab hosting type:

Parameter

Description

Access token

Use a personal access token for connection. The token must have the api scope.

By target branch

Specify names of target branches. If left blank, no filters apply.

Server URL

Specify a GitLab URL for connection.

If left blank, the URL will be extracted from the VCS root fetch URL.

Last modified: 11 June 2019