Cirrus-ci-docs: Question: conditional task execution and regex

Created on 9 May 2019  路  1Comment  路  Source: cirruslabs/cirrus-ci-docs

Greetings folks! Big fan of the service :) I'm trying to set up a job to run only on creation of tags that match a particular regex. Reading the docs:
https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution

It is hard to tell if the =~ operator accepts a regex or not:

check_aggreement_task:
  only_if: $CIRRUS_BRANCH =~ 'pull/.*'

I'd like to do something like this:

publish_task:
  only_if: $CIRRUS_TAG =~ '/^v\d+(\.\d+){2}(-.*)?$/'

I keep getting FAILED_PRECONDITION: java.lang.IllegalArgumentException when I try to use a regex, and I'm not sure if I'm just doing something wrong :)

bug

>All comments

Oh snap! Parser of expressions is chocking on the parentesises in the regex. I'll fix but in the meantime you can use something like 'v\d+\.\d+\.\d+-?.*?' to match v1.2.3-rc1 tags. Sorry for the inconvenience and thanks for reporting!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pzahemszky picture pzahemszky  路  5Comments

cevich picture cevich  路  5Comments

januswel picture januswel  路  4Comments

awnumar picture awnumar  路  5Comments

fkorotkov picture fkorotkov  路  4Comments