GitLab CI "Secret-Detection.gitlab-ci.yml could not be loaded" in CI
An include: template: for a built-in scanner (Secret Detection, SAST) could not be fetched. The template path may be wrong for your GitLab version, or the instance cannot reach the bundled template location.
What this error means
The pipeline fails to create with "Secret-Detection.gitlab-ci.yml ... could not be fetched" or "Included file ... could not be loaded". No scanning job is generated.
This GitLab CI configuration is invalid: Included file `Security/Secret-Detection.gitlab-ci.yml` could not be loadedCommon causes
Wrong template path for the GitLab version
Template names change between releases; an old path like Secret-Detection.gitlab-ci.yml may not exist on a newer or self-managed instance.
The instance cannot fetch the bundled template
A self-managed GitLab that is offline or misconfigured may fail to resolve template: includes.
How to fix it
Use the current template path
- Check the template path your GitLab version ships.
- Update the
include: template:to the correct relative path. - Re-run CI Lint to confirm the include resolves.
include:
- template: Jobs/Secret-Detection.gitlab-ci.ymlPin to a remote include if templates are unavailable
On an instance that cannot resolve bundled templates, reference the file via a remote URL for your version.
include:
- remote: 'https://gitlab.com/gitlab-org/gitlab/-/raw/master/lib/gitlab/ci/templates/Jobs/Secret-Detection.gitlab-ci.yml'How to prevent it
- Match security template paths to your GitLab version.
- Review template path changes in upgrade notes.
- Prefer pinned includes on offline self-managed instances.