Gitlab rules are not working in gitlab 13.4 version
include:
- template: SAST.gitlab-ci.yml
stages:
- build
- test
build:
allow_failure: false
image: gradle:6.4-jdk11
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
stage: build
script:
- gradle clean build
artifacts:
paths:
- build/libs
expire_in: 1 week
only:
- master
sast:
variables:
SAST_DEFAULT_ANALYZERS: "spotbugs"
SAST_DISABLE_DIND: "true"
SAST_JAVA_VERSION: "11"
COMPILE: "false"
# SECURE_LOG_LEVEL: "DEBUG"
dependencies:
- build
rules:
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_MERGE_REQUEST_ID
NOTE: According to pipeline both stages should run only on master branch only but second stage "test" runs on any branch. It is not accepting any "only" condition or gitlab "rules". Please help me out in this case.
Edited by Rémy Coutable