Regex filtering of builds on specific branches

can anyone let me know if you see anything wrong with the following filters (the regexes work fine at https://regex101.com):

   - build-only:
       filters:
         branches:
           #only: ^(?!development|test|master)([a-z0-9]+)$
           ignore: ^(?=development|test|master)([a-z0-9]+)$
   - build-and-promote:
       filters:
          branches:
           only: ^(?=development|test|master)([a-z0-9]+)$

i’m trying to split build steps so that build-only works on any branch that isn’t development|test|master while build-and-promote works only on branches development|test|master; however, all builds (even merges into development) go thru build-only), as per

build-only on development(25), build only in circle-ci
  Project
  circleci-test
  Job Number
  25

where development(25) is $CIRCLE_BRANCH($CIRCLE_BUILD_NUM)

i think i’ve just answered my own question, don’t use regexes, there’s an easier way:

jobs:
  - build-only:
      filters:
        branches:
          #only: ^(?!development|test|master)([a-z0-9]+)$
          #ignore: ^(?=development|test|master)([a-z0-9]+)$
          ignore:
            - development
            - test
            - master

  - build-and-promote:
      filters:
        branches:
          #only: ^(?=development|test|master)([a-z0-9]+)$
          only:
            - development
            - test
            - master
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.