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

**URL:** <https://discuss.circleci.com/t/circle-ci-logic-statement-in-commands-with-two-conditions-equals-and-matches-not-working-well/45527>\
**Category:** Build Environment\
**Tags:** circle-yml\
**Created:** [September 23, 2022, 9:53am UTC](https://discuss.circleci.com/t/circle-ci-logic-statement-in-commands-with-two-conditions-equals-and-matches-not-working-well/45527 "2022-09-23T09:53:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kopax-polyconseil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/kopax-polyconseil/32/31161_2.png) [@kopax-polyconseil](https://discuss.circleci.com/u/kopax-polyconseil)\
**Post date:** [September 23, 2022, 9:53am UTC](https://discuss.circleci.com/t/circle-ci-logic-statement-in-commands-with-two-conditions-equals-and-matches-not-working-well/45527/1 "2022-09-23T09:53:22Z")

</div>

I have read [Configuring CircleCI - CircleCI](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:

- when `<< pipeline.git.branch >>` is `master` (current)  
OR
- 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](https://github.com/pass-culture/pass-culture-app-native/blob/master/.circleci/config.yml#L107-L115)

This is what I have tried:

```nohighlight
      - 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:

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

```

 ![image](https://global.discourse-cdn.com/circleci/original/3X/d/2/d2c8095257d1e671f9011c9a14758f4b587cb444.png)

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 ?

---

<div class="post-metadata">

**Author:** ![kopax-polyconseil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/kopax-polyconseil/32/31161_2.png) [@kopax-polyconseil](https://discuss.circleci.com/u/kopax-polyconseil)\
**Post date:** [September 23, 2022, 12:11pm UTC](https://discuss.circleci.com/t/circle-ci-logic-statement-in-commands-with-two-conditions-equals-and-matches-not-working-well/45527/2 "2022-09-23T12:11:51Z")

</div>

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](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… Can anybody hint us why?

---

<div class="post-metadata">

**Author:** ![rit1010](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rit1010/32/34738_2.png) [@rit1010](https://discuss.circleci.com/u/rit1010)\
**Post date:** [October 24, 2022, 3:22pm UTC](https://discuss.circleci.com/t/circle-ci-logic-statement-in-commands-with-two-conditions-equals-and-matches-not-working-well/45527/3 "2022-10-24T15:22:17Z")

</div>

Sorry for the late reply.

Circleci does not process tagged-based builds unless a filter is placed on a workflow job that first checks for a branch-based build - it is an odd issue and one that shows up in the forums again and again. So you need to add

This thread has some background.
