Skip to content

Add !reference support for workflow keyword

Frédéric Caplette requested to merge fc-reference-in-workflow-rules into master

What does this MR do and why?

In the workflow:rules keyword, we need to allow the use of the !reference tag. So we add the accepted sub-type of the Ci JSON schema to accept an array of strings, which is what the !reference tag expect.

Screenshots or screen recordings

Before After
Screen_Shot_2022-06-01_at_11.35.36_AM Screen_Shot_2022-06-01_at_11.36.04_AM

How to set up and validate locally

  • Go to CI/CD editor
  • Write any CI configuration file with the !reference tag inside the workflow:rules keyword. The simplest form would be:
.cond:
  rules:
    - if: '$FORCE_GITLAB_CI'

job1:
  script: echo hello
  rules:
    - !reference [.cond, rules]
  • Hover on the !reference tag
  • Notice there are no squiggly line! 🎉

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports