comment VCS Trigger Rule not working when monitoring tags
I have a VCS Root that only fires when tags are committed (Default branch: refs/heads/dev, Branch specification: +:refs/tags/*
-:<default>, Use tags as branches ticked). I also have the configuration parameter teamcity.vcsTrigger.runBuildInNewEmptyBranch set to true in the build project settings. If I add a VCS trigger to this project and then add and push a tag to my branch, my build fires. However, I only want the build to start if the comment in the tag is correct. So I add +:comment=#testbuild:** to the Trigger rules for the VCS Trigger. But this does not change the behaviour. The build still fires regardless of what I put in the tag's comments. How can I get a build to start if I add a tag only if there is an appropriate tag in the comment?
Please sign in to leave a comment.
I was able to achieve the described behavior with the following configuration. Please test it on your side and see if it suits your requirements.
1. Version Control Settings:
Branch filter:
+:*
-:<default>
2. VCS Root:
Default branch: refs/heads/develop
Branch specification:
+:refs/tags/*
-:<default>
Use tags as branches ticked
3. VCS trigger:
Branch filter: empty
Trigger rules: +:comment=#teamcity:**
In my testing, if the #teamcity word is not present in a comment, the build doesn't start, and it starts when it is present.
Best regards,
Anton