We are trying to leverage the rules
keyword in lieu of only
/except
. We have simple goals: Do not run a job on test and production branches, and do not run if the pipeline is scheduled. This is what I came up with:
- if: '$CI_COMMIT_REF_NAME == "production" || $CI_COMMIT_REF_NAME == "test"'
when: never
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
When this ci is present, it does not run the job when initated from the web. This does work:
- if: '$CI_COMMIT_REF_NAME == "production" || $CI_COMMIT_REF_NAME == "test"'
when: never
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: $CI_PIPELINE_SOURCE == "web"```
Why do I need to explicitly allow web based as `CI_PIPELINE_SOURCE`? I get the order of operation but I see nothing in the top ci from precluding a web based run of the job.
My only guess is to try ` - if: $CI_PIPELINE_SOURCE != "schedule"` and omitting the `never`, but I still do not understand why what I have does not work. Any pointers?