continuous-integrationcirclecicircleci-2.0

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


I have read https://circleci.com/docs/configuration-reference#logic-statement-examples and I want to had a condition when the tag match a certain pattern to the logic statement:

This is our .circleci.yml conditions prior any modifications: https://github.com/pass-culture/pass-culture-app-native/blob/master/.circleci/config.yml#L107-L115

This is what I have tried:

      - when:
          condition:
            or:
              - 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

enter image description here

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 ?


Solution

  • This is how we did : https://github.com/pass-culture/pass-culture-app-native/pull/3604#issue-1383526470

    We needed to update the workflows to trigger on tags. I don't know why though.