I need to only run a pipe when the commit message does not contain WIP and the branch is a feature branch.. but whichever what i do it, it either doesn't run or like below always runs
I'm going around in circles; this is my last effort which seems to make sense to me but gets trigger no matter what the commit message says :/
stages:
- stage
- sprint
# -------------------------------------------------------------------
sprint:
stage: sprint
allow_failure: false
image: node:lts
script:
- echo 'stuff'
rules:
- if: '$CI_COMMIT_BRANCH=~ /^feature(.?)*/ && $CI_COMMIT_MESSAGE != /^WIP(.?)*/'
when: always
You are using != operator instead of !~ to match a regular expression, so right now it takes you CI_COMMIT_MESSAGE regex literally.
see https://docs.gitlab.com/ee/ci/yaml/#common-if-clauses-for-rules for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With