Trying to use Scheduled pipeline variables in Rules for include

Error with Gitlab-CI.yml file

Hi,

I am trying to set up my yml file to include a particular template conditionally, depending on the value of a variable (more specifically a scheduled pipeline variable).

I have the following snippet in my gitlab-ci.yml:

include:
  - template: Security/SAST.gitlab-ci.yml
    rules:
      - if: '$SAST == "true"'

and it is giving me an error jobs sast config should implement a script .. .

From what I’ve read here, the snippet should be valid.

What am I missing?