Skip to content

Fix problem with running scheduled policies when variables are empty

What does this MR do and why?

When no variables were provided in the policy configuration (actions), the pipeline was not executed with error: Variables key can't be blank, Variables key can contain only letters, digits and '_'., and Failed to build the pipeline! This MR fixes that problem.

How to set up and validate locally

  1. Create new project.
  2. Create new Policy Project (https://docs.gitlab.com/ee/user/application_security/policies/)
  3. Create new policy:
type: scan_execution_policy
name: Scheduled Policy
description: ''
enabled: true
rules:
  - type: schedule
    branches:
      - main
    cadence: 30 * * * *
actions:
  - scan: sast
  1. Every hour the policy should be enforced and execute a SAST scan.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #346963 (closed)

Merge request reports