GitLab CI/CD run pipeline on specific branch and don't run also on this branch when ci_commit_message is ==

Viewed 454

I need adjust Gitlab CI/CD to run when:

  1. Commit branch is from dev000 to dev999
  2. And not run when branch also is dev000 to dev999 and commit message is "test"

This is not working

workflow:
  rules:
    - if: $CI_COMMIT_MESSAGE != 'test' && $CI_COMMIT_BRANCH =~ /^dev[0-9]+$/
      when: always

Working only when branch is from dev000 to dev999 but pipeline run also when commit message is "test".

0 Answers
Related