I am testing with using
source: rules: - if: '$GITLAB_CI == "true"' script: - echo hi test: rules: - !reference [source, rules] script: - echo hi
With the above config I get the following error.
This GitLab CI configuration is invalid: jobs:test rules should be an array of hashes.
I’m not sure if this is a bug in the docs (it doesn’t say where
!reference can/can’t be used) or a bug in the
!reference for rules itself.
Rules are one of the places I find a lot of duplication, but always with some variation.
This means the !reference option is of great value.