Update file sast.yml

This commit is contained in:
Melissa Beldman 2025-06-03 16:25:47 +00:00
parent 3f2b327a85
commit c06a78445c

View file

@ -21,6 +21,9 @@ spec:
type: boolean type: boolean
include_experimental: include_experimental:
default: 'false' default: 'false'
enable_mr_pipelines:
default: false
type: boolean
ff_glas_enable_php_support: ff_glas_enable_php_support:
default: true default: true
type: boolean type: boolean
@ -122,6 +125,10 @@ spec:
- '**/application*.yaml' - '**/application*.yaml'
- '**/bootstrap*.yaml' - '**/bootstrap*.yaml'
.pmd-apex-exist-rules:
exists:
- '**/*.cls'
gitlab-advanced-sast: gitlab-advanced-sast:
extends: .sast-analyzer extends: .sast-analyzer
image: image:
@ -179,9 +186,23 @@ pmd-apex-sast:
rules: rules:
- if: '"$[[ inputs.excluded_analyzers ]]" =~ /pmd-apex/' - if: '"$[[ inputs.excluded_analyzers ]]" =~ /pmd-apex/'
when: never when: never
# The following 3 blocks of rules define whether the job runs in a an *MR pipeline* or a *branch pipeline*
# when an MR exists. If the job has additional rules to observe they should be added in the blocks 1 and 3
# to cover both the *MR pipeline* and the *branch pipeline* workflows.
# 1. Run the job in an *MR* pipeline if MR pipelines for AST are enabled and there's an open merge request.
- if: '$[[ inputs.enable_mr_pipelines ]]" == "true" &&
$CI_PIPELINE_SOURCE == "merge_request_event"'
exists: !reference [.pmd-apex-exist-rules, exists]
# 2. Don't run the job in a *branch pipeline* if *MR pipelines* for AST are enabled and there's an open merge request.
- if: '"$[[ inputs.enable_mr_pipelines ]]" == "true" &&
$CI_OPEN_MERGE_REQUESTS'
when: never
# 3. Finally, run the job in a *branch pipeline* (When MR pipelines are disabled for AST, or it is enabled but no open MRs exist for the branch).
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH
exists: exists: !reference [.pmd-apex-exist-rules, exists]
- '**/*.cls'
security-code-scan-sast: security-code-scan-sast:
extends: .sast-analyzer extends: .sast-analyzer