Circle-CI - logic statement in commands with two conditions: equals and matches not working well

I have read Configuring CircleCI - CircleCI and I want to had a condition when the tag match a certain pattern to the logic statement:

  • when << pipeline.git.branch >> is master (current)
  • if << pipeline.git.tag >> is of pattern /^(patch\/)?v.*/ or /^hotfix-.*/

This is our .circleci.yml conditions prior any modifications: pass-culture-app-native/config.yml at master · pass-culture/pass-culture-app-native · GitHub

This is what I have tried:

      - when:
              - equal: ["master", << pipeline.git.branch >>]
              - matches:
                  pattern: /^(patch\/)?v.*/
                  value: << pipeline.git.tag >>

Circle-CI does not run the commands when doing the following:

git tag patch/v1.199.99
git push origin patch/v1.199.99

Condition doesn’t match when << pipeline.git.tag >> is patch/v1.199.99 and thus doesn’t run the pipeline, any clue what am I doing wrong here ?

This is how we did : (PC-17580) ci(Patch): run unit tests on patch and hotfix by kopax-polyconseil · Pull Request #3604 · pass-culture/pass-culture-app-native · GitHub

We needed to update the workflows to trigger on tags. I don’t know why… Can anybody hint us why?