Git tag could not trigger the job in the flow when there are config.yml and continue_config.yml

My config.yml is:

version: 2.1
orbs:
  android: circleci/android@2.4.0
  path-filtering: circleci/path-filtering@0.1.3

setup: true

workflows:
  run-filter:
    jobs:
      - path-filtering/filter:
          base-revision: main
          config-path: .circleci/continue_config.yml
          mapping: |
            app/.* code_changed true
          filters:
            branches:
              only:
                - /.*/
            tags:
              only:
                - /.*/

And my continue_config.yml is:

version: 2.1
orbs:
  android: circleci/android@2.4.0
  path-filtering: circleci/path-filtering@0.1.3

setup: true

workflows:
  run-filter:
    jobs:
      - path-filtering/filter:
          base-revision: main
          config-path: .circleci/continue_config.yml
          mapping: |
            app/.* code_changed true
          filters:
            branches:
              only:
                - /.*/
            tags:
              only:
                - /.*/

When I push the tag “release-xxx”, only run-filter was trigger, but the run-log-test was not trigger. How to fix and let it work?

You have posted the same file twice.

Sorry. pasted by mistake. my continue_config.yml file is:

version: 2.1
orbs:
  android: circleci/android@2.4.0

jobs:
  start:
    docker:
      - image: cimg/base:2022.05
    steps:
      - checkout
      - run:
          name: "start the flow"
          command: "echo start!"

  test_tag:
    docker:
      - image: cimg/base:2022.05
    steps:
      - run:
          name: "test tag"
          command: "echo test tag!"

workflows:
  prime-workflow:
    jobs:
      - start

  run-log-test:
    jobs:
      - test_tag:
        filters:
          tags:
            only: /.*/
          branches:
            only: /.*/

This is a common ‘state’ issue with the way that CircleCI processes workflows and filters.

While a filter looks like there is an implied ‘or’ between the ‘branches’ option and the ‘tags’ option this is not in fact how it works. The branch check is performed first and then the tag check.

You should be able to see the issue if you look at the “preparing environment variables” step in the dashboard.

  • If the project is run due to a change to the branch you will see an environment variable “CIRCLE_BRANCH” set to the name of the branch changed.

  • If the project is run due to a tag being set you will see an environment variable “CIRCLE_TAG” set to the tag set.

The result is that when a tag is set any branch check is done against an environment variable that is not set and so the the only acceptable check is ‘ignore’ which causes the branch check to be skipped and the tag check to take place. A past thread on the issue can be seen here

The result is that you have to reconsider your logic so that you have workflows defined with filters that target the situation when different branches are modified and other workflows that look for tags.