Disabling Imported Jobs In Gitlab CI/CD Pipeline
Small one today. I’ve got a Gitlab CI/CD file that imports a much larger one defining a standard set of jobs for a build. But I needed to disable one of those jobs as it didn’t apply to the project I’m working on.
So after trying a few things, the approach I found that worked was to “override” the jobs in my Gitlab CI/CD file and configure the rules to execute “never”.
include:
- project: standard/pipelines
ref: main
file: build.yaml
# This is the jobs that you want to disable in your pipeline
go:test:
rules:
- when: never