I configured git pull requests my teamcity server for QA testing environment. If I use TeamCity feature branching integration, I can get branch name with this property: %teamcity.build.branch%
.
When use pull request, the %teamcity.build.branch%
property return pull request number (1,2,3 etc).
How can I get pull request branch name?
To run builds from a specific branch or set of branches automatically, configure build triggers. You can also filter history by a branch name if you're interested in a particular branch. TeamCity assigns a branch label to the builds from the default branch too.
Branch filter description. Version Control Settings of a build configuration. Limit the set of branches available for the build configuration. This branch filter is applied before any other branch filter and limits branches shown in the custom build dialog, as well as branches visible to triggers and build features.
Parameter teamcity.build.branch is a logical branch, i.e. it's a part of a branch from your branch specification matched by *.
There is another parameter teamcity.build.vcs.branch.<VCS root ID> which contains full Git branch name. Seems this is what you need.
You can read more on this in documentation: http://confluence.jetbrains.com/display/TCD8/Predefined+Build+Parameters#PredefinedBuildParameters-BranchRelatedParameters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With