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

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
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:

    workflows:
      build_and_push:
        jobs:
          - build_push_test:
              filters:
                tags:
                  only: /.*aefdefwefwefwfwefwefwefwf.*/
    

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

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

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.

1 Like