CircleCI ignores tag filters

I have the following (shortened) config.yml file:

release-tag-only: &release-tag-only
  filters:
    tags:
      only: /^v[0-9]+\.[0-9]+\.[0-9]+$/
    branches:
      ignore: /.*/
...
workflows:
  release:
    jobs:
      - unit-test-android-release:
          <<: *release-tag-only
      - release-android-app:
          <<: *release-tag-only
          requires:
            - unit-test-android-release

As you might have guessed, I want the release workflow to be triggered only when I create a tag of a specific format (e.g. v0.0.1). However, this config has no effect and creating such a tag does not trigger the workflow. I have tried many different combinations and solutions found online, but nothing works for me. What am I missing with my config?

For the record, I have also tried the following logic statement on the workflow, but no success either:

workflows:
  release:
    when:
      matches:
        pattern: "^v[0-9]+.[0-9]+.[0-9]+$"
        value: << pipeline.git.tag >>
    jobs:
      - unit-test-android-release
      - release-android-app:
          requires:
            - unit-test-android-release

Hi @hidayatrzayev ,

Thank you for sharing your question on our forum.

I have tested the following config in a sample project:

version: 2.1

jobs:
  unit-test-android-release:
    docker:
      - image: cimg/base:edge
    steps:
      - checkout
  release-android-app:
    docker:
      - image: cimg/base:edge
    steps:
      - checkout

release-tag-only: &release-tag-only
  filters:
    tags:
      only: /^v[0-9]+\.[0-9]+\.[0-9]+$/
    branches:
      ignore: /.*/

workflows:
  release:
    jobs:
      - unit-test-android-release:
          <<: *release-tag-only
      - release-android-app:
          <<: *release-tag-only
          requires:
            - unit-test-android-release

The initial commit did not trigger a workflow, but a workflow was triggered when pushing a release for the tag v1.0.0:

Could you take a look, and let me know if you see any differences between your config and the sample above?

One additional thing you can check is if there was a webhook payload sent to CircleCI when the tag was pushed:

For the second case, you will still need to add <<: *release-tag-only to the jobs in the release workflow as the job filter is still checked even if you use the when conditional for the workflow itself.

If you would like us to take a closer look at a specific build, please open a support ticket below:
https://support.circleci.com/hc/en-us/requests/new

Thank you!

Hi @aaronclark , thanks for your reply! Indeed, it seems to be an issue with the webhook, there is none in my repository! I thought that it would automatically be setup based on the config file. But somehow my other workflow configured for commits works nevertheless. I am new to CircleCI, is there a documentation describing how to manually create a webhook, which payload URL should be specified etc.?

Hi @hidayatrzayev,

A webhook will be created for the project automatically when setting it up on CircleCI.

Could you go to the project dashboard for your organization, and click the “set up project” button for the specific project?

Following that, builds will trigger for that repository.

Hi @aaronclark ,

All I see in the projects page is an option to follow or unfollow a project. And there is a button to create a new project on top.
image
image

In the “Dashboard” pane I see my latest executed workflows. Am I looking in the wrong place?