How to prevent a job to be not must be included in a gitlab

39 views Asked by At

I have a gitlab-ci.yml file with 3 stages, and users are including it to add their repositories. The problem is, if they don't include the 3rd job, the pipeline will not work. i want users to avoid error: "error : This GitLab CI configuration is invalid: deploy:grafana-email job:". I want this job to be optional, not mandatory when they refer and include to my repository . I tried using allow_failure and rules and execpt , but I'm still facing the same issue. I would appreciate it if anyone could help me with that.

configurations for 3rd job 
deploy:grafana-email:
  stage: grafana-email
  environment:
    name: prod
  extends:
    - .common_config
  script:
    - chmod +x email.sh
    - ./email.sh
  when: manual
0

There are 0 answers