Add updated workflow rules to json schema
What does this MR do and why?
Related to #345352 (closed)
This adds the missing rules:changes and rules:exists definitions under the workflow keyword in the json schema for gitlab-ci.
With this, the user will be able to use workflow:rules:changes and workflow:rules:exists in their .gitlab-ci.yml file without triggering syntax errors from the validator.
More info on how these rules are used in: https://docs.gitlab.com/ee/ci/yaml/#workflow
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
-
Enable the
schema_lintingfeature flag. (rails cthenFeature.enable(:schema_linting)) -
Go the the pipeline editor (CI/CD > Editor).
-
Paste the following content to your
.gitlab-ci.ymlfile:workflow: rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' exists: - Dockerfile changes: - Dockerfile variables: IS_A_FEATURE: "true" when: always -
There should be no syntax errors from the content. If you try this on the pipeline editor without the MR changes, you'll find syntax errors similar to the screenshots above.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.

