Conditional Step from tag regex

Hello,

I’m trying to trigger builds based on a regex for a tag on github.

I’ve tried both of these, but it appears to not work as it doesn’t show up in the build workflow. To my understanding CF_BRANCH returns the tag name but I’m not sure what I’m doing wrong for these conditions to pass. The tag is “dev-test1”

test_dev_only:
  title: "Packaging project"
  image: codefresh/build-cli
  type: "freestyle"
  stage: "Prepare"
  commands:
    - echo "This works"
  when:
      branch:
        only:
          - /^((dev))-.*/gi
test_dev_only:
  title: "Packaging dev project"
  image: codefresh/build-cli
  type: "freestyle"
  stage: "Prepare"
  commands:
    - echo "This works dev"
  when:
      condition:
        all:
          executeForDevTags: "match('${{CF_BRANCH}}','^((dev))-.*\\i',true)"

Looks like the build step wasn’t showing due to tabbing under an existing step, interesting that it didn’t fail for an unknown key value.

But anywho I can test the condition how, however it appears that my match is failing
match(‘dev-test3’,‘^((dev))-.*\i’,true) evaluates to false. I’ll try more things but when using a regex tester that string does match.

I discovered that the issue is that I’m attempting to set a flag within the match for ignore case, but match already takes a param to ignore case (third arg). It is now working as intended!

I am glad it works out for you.

Let us know if you have other questions.

Welcome to the Codefresh community!