Tag not triggered by CircleCI not filter in workflow

Since 1 week I try to use tag filtering to deploy only tag that start with v.
I read this doc : https://circleci.com/docs/2.0/workflows/#using-contexts-and-filtering-in-your-workflows

But my tag was never trigger and/or never filter by CircleCI. I try to push my tag with multiple way:

  • git push origin my-branche myTag
  • git push origin myTag
  • git push origin --tags

Nothing works. Below is the last config I have used:

workflows:
  version: 2
  build-test-and-approval-package:
    jobs:
      - build-and-test:
          filters:
            tags:
              only: /.*/
      - package:
          requires:
            - build-and-test
          filters:
            tags:
              only: /.*/
            branches:
              ignore: /.*/

Another thing that I noticed is that $CIRCLE_TAG is not defined. Any one can help?
thank you

So this should work:


workflows:
  version: 2
  build-test-and-approval-package:
    jobs:
      - build-and-test:
          filters:
            tags:
              only: /^v.*/
      - package:
          requires:
            - build-and-test
          filters:
            tags:
              only: /^v.*/
            branches:
              ignore: /.*/

Then running:


git tag v1.0.0

git push origin tag v1.0.0

$CIRCLE_TAG is only present during tag builds (i.e. it won’t show when building branches).
Just as a note: if you’re on the CircleCI dashboard and you’ve clicked on a branch to view all of its jobs, you won’t see the tag building (since a tag is not a branch). Say your repository is called test-repo and your branch that you have tagged is develop. If you’re clicked on the develop branch on CCI to view all the branches jobs you’ll have to click on test-repo to see all jobs for that repo - it’s the only way you can view the tags being built, from what I can see.

Thank you, my config was right. The problem come from the way I push the tag.

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