# Trigger build for new tag on Git-Repo

**URL:** https://www.finalbuilder.com/forums/t/trigger-build-for-new-tag-on-git-repo/6094
**Category:** Bugs
**Created:** [December 7, 2017, 9:00am UTC](https://www.finalbuilder.com/forums/t/trigger-build-for-new-tag-on-git-repo/6094 "2017-12-07T09:00:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rynardald](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@rynardald](https://www.finalbuilder.com/forums/u/rynardald)
#### Post date: [December 7, 2017, 9:00am UTC](https://www.finalbuilder.com/forums/t/trigger-build-for-new-tag-on-git-repo/6094/1 "2017-12-07T09:00:10Z")

</div>

Hi Support-Team,  
I had some problems with detecting tags from a Git-repository. What I wanted to have is that my configureation should trigger a new build when it detects a new tag on my git repo based on the tagged commit.  
For this i created following configuration:  
  
Git-Repository

- Branches: Branches to monitor: All branches
- Tags: Tag Changes: Detect 

Trigger on my configuration 

- Trigger: Type: Repository
- Repository: Quiet Period: 0
- Trigger Branch: Trigger on: All branches 
- Trigger Branch: Skip commits previously build by this trigger: off
- Tags: Trigger: Tag changes for matching pattern
- Tags: Tag Pattern: ‘^(\d+).(\d+).(\d+)(\w\*)$$’ (I want only tags like ‘1.3.22’ or 1.2.3hf1’)
- Tags: Trigger on new tags: on
- Tags: build tagged changeset: on
- Tags: Only trigger on tag changes: on

Now I pushed some tags to my repo but in many cases the tag was not recognized (in some cases i got a new commit-changeset with message ‘Inserted ligthweight tag ‘…’’ - i tried also on my repo the setting Tags: Tag changes: Detect and list as new changeset) and in most cases the build did not worked on the tagged changeset but on my master (the tags i created were on other commits).

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [December 11, 2017, 5:59am UTC](https://www.finalbuilder.com/forums/t/trigger-build-for-new-tag-on-git-repo/6094/2 "2017-12-11T05:59:36Z")

</div>

Hi Albrecht,  
  
Thank you for reporting this. The tag detection was broken when making changes to deal with duplicates in the previous version. Please download [version 1.8.1.689](https://www.finalbuilder.com/downloads/continuaci/continuaci-version-history-v1.8.1) and let us know whether this fixes your issue. Note that “Tag changes” need to be set to “Detect and list as new changeset” to trigger builds from a tag.&nbsp;

---

<div class="post-metadata">

### Author: ![rynardald](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/a88e57/32.png) [@rynardald](https://www.finalbuilder.com/forums/u/rynardald)
#### Post date: [December 11, 2017, 9:06am UTC](https://www.finalbuilder.com/forums/t/trigger-build-for-new-tag-on-git-repo/6094/3 "2017-12-11T09:06:19Z")

</div>

Hi Dave,  
I checkt your new version and now the tags are detected correct and the builds are triggered.  
The problem that I have now is that when I’m building triggered by a new tag $Source.Repo.Tag$ and $Source.Repo.BuildChangesset.Tagnames$ are not evaluated. Logging this expressions returns a empty result.

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [December 12, 2017, 4:33am UTC](https://www.finalbuilder.com/forums/t/trigger-build-for-new-tag-on-git-repo/6094/4 "2017-12-12T04:33:07Z")

</div>

Hi Albrecht,

Thanks again for your report. We have now made some changes so that the $Source.Repo.BuiltChangeset$ has details of the correct changeset when built from a tag change trigger.

Note that $Source.Repo.Tag$ should only contain a tag name if the build is started for a tag e.g. a tag name is selected in the Queue Options dialog.

You can download the updated build using the following links:.

- [Download Continua CI v1.8.1.690 (64 bit)](http://downloads.finalbuilder.com/downloads/continua/1.8.1/ContinuaCI.Server.Setup_x64_1.8.1.690.exe)
- [Download Continua CI v1.8.1.690 (32 bit)](http://downloads.finalbuilder.com/downloads/continua/1.8.1/ContinuaCI.Server.Setup_1.8.1.690.exe)
- [Download Agent Installer v1.8.1.690 (64 bit)](http://downloads.finalbuilder.com/downloads/continua/1.8.1/ContinuaCI.Agent.Setup_x64_1.8.1.690.exe)
- [Download Agent Installer v1.8.1.690 (32 bit)](http://downloads.finalbuilder.com/downloads/continua/1.8.1/ContinuaCI.Agent.Setup_1.8.1.690.exe)
