I want to run a gitlab job in every case EXCEPT the variable RUN is defined and contains the value run3.
So again:
- variable
RUNis undefined: run the job - variable
RUNis defined and does not contain the valuerun3: run the job - variable
RUNis defined and does contain the valuerun3: DO NOT run the job
I tried the following rules:
rules:
- if: $RUN != null && $RUN == "run3"
when: never
rules:
- if: $RUN != "" && $RUN == "run3"
when: never
rules:
- if: $RUN == "run3"
when: never
Without the variable RUN being defined, no job was run. I expected the job to have been run.
How to fix it? Where is the problem in the logic?