Job running even though not all rules evaluate to true

47 Views Asked by At

The docs say "The rule evaluates to true only when all included keywords evaluate to true". But in my case when I change and push a file not included in my changes keyword file list, the job runs.

stages:
  - test
  - build
  - tag

.files: &files
  - .gitlab-ci.yml
  - source/**/*

only_changes:
  extends: .my-job
  script:
    - echo "job runs"
  rules:
    - if: '$CI_MERGE_REQUEST_ID || $CI_COMMIT_BRANCH == "dev" || $CI_COMMIT_BRANCH == "master"'
      changes: *files

I push a commit where I only change some markdown file outside of source/ and yet the only_changes job still runs. What am I not getting? Is this a mistake in the docs and it should say the job runs if any of the rules evaluates to true?

0

There are 0 best solutions below