title: How to run a TeamCity build only for tags?
body: <p>I have several projects that produce NuGet packages that I publish to an internal server. We're using <a href="http://semver.org" rel="noreferrer">semantic versioning</a>, and using tags in our Git repository to control the version numbers.</p>
  
  <p>I'm tagging like this:</p>
  
  <pre><code>git tag -a v1.0.0 -m "tagged"
  </code></pre>
  
  <p>And, during the TeamCity build, I run <code>git describe --long</code>, which produces an output like this:</p>
  
  <pre><code>v1.0.0-0-ge9c047d
  </code></pre>
  
  <p>The fourth number in the output is the number of commits after the tag. The <code>0</code> here means that no commits have been made since the tag. I use these first four numbers as the version number (and, incidentally, the entire string as the AssemblyInformationalVersion).</p>
  
  <p>I have TeamCity package and publish a NuGet package, but here's where it gets sticky. I only want to publish tags, never commits after tags (because the version number in that case would be wrong, possibly VERY wrong).</p>
  
  <p>I've tried setting the "branch specification" in the VCS root to "+:refs/tags/*", which causes all the tags to be built, but TeamCity also insists on building the "default branch" as well. If I set the "default branch" to something that doesn't exist, I get an error.</p>
  
  <p>I've thought about ending the build early if a particular build isn't a tag, but I can't figure out how to do that without FAILING the build, which isn't what I want.</p>
  
  <p>How do I cause one or more build steps to only run for new tags, and not regular commits?</p>