title: GitLab CI/CD - Using Both Includes: and Needs:
body: <p>I'm working off the Auto-Devops template for my .gitlab-ci.yml.  Trying to use both <code>include:</code> and <code>needs:</code> as part of a GitLab partner lab.  The CI Lint tool says this is valid, but the pipeline fails, saying &quot;dast: needs 'dast_environment_deploy'&quot;.  After attempting the below code, I even tried copying the content of the entire dast_environment_deploy template and placing that in the file, still getting the same error.</p>
  <p>How do I get my pipeline file to use <code>needs:</code> based on an <code>include:</code> template?</p>
  <pre class="lang-yaml prettyprint-override"><code>image: alpine:latest
  
  stages:
    - build
    - test
    - scan
    - deploy  # dummy stage to follow the template guidelines
    - review
    - dast
    - staging
    - canary
    - production
    - incremental rollout 10%
    - incremental rollout 25%
    - incremental rollout 50%
    - incremental rollout 100%
    - performance
    - cleanup
  
  scan:
      stage: scan
      trigger:
          include:
              - template: Security/License-Scanning.gitlab-ci.yml
              - template: Security/Container-Scanning.gitlab-ci.yml
              - template: Security/Dependency-Scanning.gitlab-ci.yml
  
  review:
    needs: [&quot;build&quot;]
  
  dast:
    needs: [&quot;dast_environment_deploy&quot;]
  
  sast:
    needs: []
  
  cache:
      paths:
          - node_modules
  
  include:
    - template: Jobs/Build.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Build.gitlab-ci.yml
    - template: Jobs/Test.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Test.gitlab-ci.yml
    - template: Jobs/Code-Quality.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml
    - template: Jobs/Code-Intelligence.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Code-Intelligence.gitlab-ci.yml
    - template: Jobs/Deploy.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
    - template: Jobs/Deploy/ECS.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Deploy/ECS.gitlab-ci.yml
    - template: Jobs/Deploy/EC2.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Deploy/EC2.gitlab-ci.yml
    - template: Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml
    - template: Jobs/Browser-Performance-Testing.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Browser-Performance-Testing.gitlab-ci.yml
    - template: Security/DAST.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Security/DAST.gitlab-ci.yml
    - template: Security/SAST.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Security/SAST.gitlab-ci.yml
    - template: Security/Secret-Detection.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Security/Secret-Detection.gitlab-ci.yml
  </code></pre>