Avoid creating rules that generate double pipelines

Error: Rules used could create a double pipeline
Bridgecrew Policy ID: BC_REPO_GITLAB_CI_2
Checkov Check ID: CKV_GITLABCI_2
Severity: LOW

Ensure that rules don't generate double pipelines

Description

The use of multiple trigger rules in a CI configuration file can lead to duplicate pipelines running. For example, if there is a trigger for every push and a trigger for merge request events, both triggers could be true and thus create two pipelines.

Example Fix

Try to keep the number of trigger sources down to one

planOnlySubset:
  script: echo "This job creates double pipelines!"
  rules:
    - changes:
        - $DOCKERFILES_DIR/*
    - if: $CI_PIPELINE_SOURCE == "push"
-    - if: $CI_PIPELINE_SOURCE == "merge_request_event"