# Git tags not working. It triggers the build despite what I define

**URL:** <https://discuss.circleci.com/t/git-tags-not-working-it-triggers-the-build-despite-what-i-define/27757>\
**Category:** Build Environment\
**Created:** [January 18, 2019, 4:41pm UTC](https://discuss.circleci.com/t/git-tags-not-working-it-triggers-the-build-despite-what-i-define/27757 "2019-01-18T16:41:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonzalomarcote](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/gonzalomarcote/32/21176_2.png) [@gonzalomarcote](https://discuss.circleci.com/u/gonzalomarcote)\
**Post date:** [January 18, 2019, 4:41pm UTC](https://discuss.circleci.com/t/git-tags-not-working-it-triggers-the-build-despite-what-i-define/27757/1 "2019-01-18T16:41:23Z")

</div>

Hi,

I’m struggling my head to try to understand how git tags are working [https://circleci.com/docs/2.0/workflows/#executing-workflows-for-a-git-tag](https://circleci.com/docs/2.0/workflows/#executing-workflows-for-a-git-tag)  
And looking for all the comments related seems that I am not the only one. So something could be not well explained in the documentation.

I want to execute the build only when it matches some specific git tag.  
Let’s say for example the `config-test-circleci` tag

So I do the following:

- Being in my `test` branch I commit some changes

- I create one tag with `git tag config-test-circleci` and push it with `git push`

- I can see the tag there if I do one `git tag`

- In my config.yaml I have the following config:

Obviously `aefdefwefwefwfwefwefwefwf` does not match with the `config-test-circleci` git tag. but it execute the build the same… Why???  
What is failing here?.

If I configure my config.yaml with:

```
  workflows:
    build_and_push:
      jobs:
        - build_push_test:
            filters:
              tags:
                only: /^config-test.*/
              branches:
                ignore: /.*/

```

It does not execute the build.  
Why?

How can I execute the build in one branch when it match _ONLY_ que it match some specific git tag?  
Honestly I am totally confused about how this works.  
Any help will be much appreciated.

Gonzo

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [April 18, 2019, 4:41pm UTC](https://discuss.circleci.com/t/git-tags-not-working-it-triggers-the-build-despite-what-i-define/27757/2 "2019-04-18T16:41:30Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![Henna](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/henna/32/29402_2.png) [@Henna](https://discuss.circleci.com/u/Henna)\
**Post date:** [September 22, 2020, 9:44pm UTC](https://discuss.circleci.com/t/git-tags-not-working-it-triggers-the-build-despite-what-i-define/27757/3 "2020-09-22T21:44:29Z")

</div>

Hi @gonzalomarcote,  
CircleCI does not run workflows for tags unless you explicitly specify tag filters. However, if you push a fresh commit the workflow will run.

In order to trigger a workflow based on a tag, you can use tag filtering. If you have a look at your pipelines page, you will see a tag icon under the “branch/commit” heading. If the tag icon is present this indicates a tag was committed, which created a pipelines. This particular pipeline will not run unless you use [tag filtering to execute workflows](https://circleci.com/docs/2.0/workflows/#executing-workflows-for-a-git-tag).
