Restrict a job creation with multiple "only" conditions to respect at a time

Hello

I’m using Gitlbab Version 13.10 and I currently try, in a my CI to restrict the creation of a job only if it respects multiple criteria.
Apparently the “only” condition in a CI job allows the combination of mutliple criteria.
I therefore have a job like this:

my_job:
  << *mymainjob
  variables:
    APP :app1
  except: 
    - schedules
  only:
    refs:
      - develop
      - master
    variables:
      - ENV =~ /^(dev|stg)$/
      - APP =~ /^(app1|app2|app3)$/

With this, I would therefore expect that, when I push new code on branch develop , the job is not created (as ENV variable is not set ).
But the job is still created .
I do not understand .
Can you please help ?

Hi @LB4gitlab
when/only is deprecated and rules should be used instead.
With rules you can easily make the condition you need.

Example:

rules:
  - if: '$CI_COMMIT_BRANCH == "develop" && $ENV'
    when: always

Thanks for your reply. In the meantime, i also found my error. My different conditions on variables are treated as a “or”.
As long as the condition on 1 variable is true, the condition is true