I want to run a Gitlab pipeline stage after pushing a commit on the 'master' branch and a directory named 'tests' exists in the project root. Here is the relevant snippet from .gitlab-ci.yaml that defines the stage and its rules:
stage: test
image: python:3.10.3-bullseye
rules:
- if: $CI_COMMIT_BRANCH == "master"
exists:
- tests
before_script: *setup-python
script:
- pip install -e .[dev]
- pytest tests/
However, after a commit on the master branch, it remains disabled. I'm a bit fuzzy on the syntax, despite reading the docs carefully. Does anyone know how to achieve what I'm after?