SAST template make CI conf invalid when `test` stage is not available

Summary

With the recent introduction of a DinD-free version recently, CI configurations without a test stage defined will be invalid. When viewing the .gitlab-ci.yml file, you will see an error similar to This GitLab CI configuration is invalid: bandit-sast job: stage parameter should be check.

And pipelines will fail with a yaml invalid error. Example: https://gitlab.com/gitlab-org/gitlab-ui/pipelines/83190158

Steps to reproduce

Use this config file:

stages:
  - check

include:
  template: SAST.gitlab-ci.yml

sast:
  stage: check
  only:
    - merge_requests
    - master

Will result in This GitLab CI configuration is invalid: bandit-sast job: stage parameter should be check

Example Project

https://gitlab.com/tanuki-workshops/devsecops/cupcake/blob/master/.gitlab-ci.yml

What is the current bug behavior?

GitLab-CI configuration is invalid

What is the expected correct behavior?

GitLab-CI configuration is valid, but the documentation might need to be updated.

Possible fixes

Maybe update the documentation do explain how to use this new template (Users probably need to update .sast instead of sast

Edited by rossfuhrman