Documentation error or bug for "only.variables"

Replace this template with your information

Describe your question in as much detail as possible:
The documentation in CI/CD YAML syntax reference | GitLab writes:
<<
With only , individual keys are logically joined by an AND:
(any of refs) AND (any of variables) AND (any of changes) AND (if Kubernetes is active)

meaning that the result of the “variables” would be joined by an OR.

  • What are you seeing, and how does that differ from what you expect to see?
    The pipeline below however runs when I commit+push into the “release-branch”. I’m perfectly happy with this, but the documentation states that it should work different.
    Is the documentation wrong?
    Do I misunderstand the documentation?
    Or is this is bug?

    stages:
    - build

    .prevent-when-tag-or-releasebranch:
    except:
    refs:
    - tags # prevents running job, when a new tag is created
    only:
    variables:
    - $CI_BUILD_BEFORE_SHA != “0000000000000000000000000000000000000000” # prevents running job, when a new branch is created
    - $CI_COMMIT_BRANCH !~ /^release-sxris-/ # prevents running job, when branch is a release branch

    hello-build:
    extends: .prevent-when-tag-or-releasebranch
    stage: build
    script:
    - echo “Hello build”
    - sh -c “env|sort”

  • What version are you on? Are you using self-managed or GitLab.com?

    • GitLab (Hint: /help): 12.9.2-ee
    • Runner (Hint: /admin/runners): 12.7.1
  • Add the CI configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml)

  • What troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

Thanks for taking the time to be thorough in your request, it really helps! :blush: