Hi guys,
I’m trying to fully skip a job if I have changes, in a specific colder, in a branch diff VS master.
I have something like this
activation-sast:
stage: sast
before_script:
- apk update && apk add git
- git fetch
- ACTIVATION_HAS_CHANGES=$(git diff --name-only $(git rev-parse HEAD) origin/master | grep services/activation/src || echo ‘FALSE’)
script:
- echo “###ACTIVATIONCHANGES###”
- echo $ACTIVATION_HAS_CHANGES ## this works, outputs a list of files or FALSE
- echo “######”
rules:
- if: $ACTIVATION_HAS_CHANGES != “FALSE” # THIS DOES NOT WORK
when: always
it seems that the variable $ACTIVATION_HAS_CHANGES does not exist within the rules scope.
Is there a way to do this?
Thanks in advance for your time