Job rule: help (multiple if statements)

With gitlab CI/CD, is there an example anywhere of providing multiple if statement to a rule: that limits when a job will run?

For example, I only want a rule to run if a commit was on either one of two branches, but not any other branch.

this fails (says .yml syntax error)

rules:
    - if: '$CI_COMMIT_BRANCH == "main" or $CI_COMMIT_BRANCH == "prod"'
        changes:
          - requirements.txt

Hi @devlocalca

These .gitlab-ci.yml scripts essentially use Bash syntax, so I think you want something like this:

rules:
    - if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "prod"'
      changes:
          - requirements.txt