Skip to content

Fix scan execution policy without ci file

What does this MR do and why?

This fixes running scan execution policy jobs even if the project does not have a .gitlab-ci.yml file. The bug is described in more detail here: #434321 (comment 1757766354)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Create a project without a .gitlab-ci.yml file
  2. On the left sidebar, select Security & Compliance and Policies
  3. Select New Policy
  4. Select Scan execution policy
  5. Switch to .yaml mode and paste the following policy:
    type: scan_execution_policy
    name: test
    description: ''
    enabled: true
    rules:
      - type: pipeline
        branch_type: all
    actions:
      - scan: secret_detection
  6. Select configure with a merge request and merge the MR.
  7. Go back to the initial project. You should now be able to start a pipeline

Related to #434321 (closed)

Merge request reports