MR pipeline created with Scan execution policies

Summary

Customer reported that MR pipelines are being created for Scan Execution policies using default template.

This has been reproduced on gitlab.com

The pipelines fail with error The pipeline failed due to an error on the CI/CD configuration file. since no .gitlab-ci.yml exists

Screenshot_2025-03-21_at_9.48.20_AM

Steps to reproduce

  1. Create a project
  2. Add scan execution policy with template: default
  3. Create a branch, push a change and create a MR
  4. A pipeline is created on the MR but it fails.

Example Project

https://gitlab.com/gerardo_ultimate_group/tickets/indeed/611102/-/merge_requests/1/pipelines#8ec9a00bfd09b3190ac6b22251dbb1aa95a0579d

What is the current bug behavior?

Merge request pipelines get created with the absence of ci file or using template: default

What is the expected correct behavior?

Merge request pipelines should not be create.

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes