In my gitlab-ci yamls I use:
only: - triggers
I know that
only is slowly becoming obsolete, although it can still be used, but I’d like to use
rules for the new projects in any case.
So how could I replace this so using
I’ve had a look at the documentation (Keyword reference for the `.gitlab-ci.yml` file | GitLab )and they can’t be used together in the same job. If you configure one job to use both keywords, the GitLab returns a
key may not be used with rules error., but I’m not sure how I can do it.
rules: - if: triggers
Or maybe this?
rules: - exists: '$CI_PIPELINE_TRIGGERED'