Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

gitlab-ci skipped the manual step and continue

I have the following GitLab-ci YAML file. the manual job gets skipped, and the pipeline completes successfully even though the manual job did not get triggered.

How can I fix it and why did this happen?

stages:
  - stage1
  - stage2

job1:
  stage: stage1
  script:
    - echo "this is an automatic job"

manual_job:
  stage: stage2
  script:
    - echo "This is a manual job"
  when: manual

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

This happens because manual jobs are considered optional, and do not need to run.

Internally, manual jobs have allow_failure set to true by default, which means that these skipped manual jobs do not cause a pipeline failure. The YAML code below demonstrates how to write the manual job, which results in the same behavior. The job doesn’t automatically start, is skipped, and the pipeline passes.

stages:
  - stage1
  - stage2

job1:
  stage: stage1
  script:
    - echo "this is an automatic job"

manual_job:
  stage: stage2
  script:
    - echo "This is a manual job"
  when: manual
  allow_failure: false

You can set allow_failure to true for any job, including both manual and automatic jobs, and then the pipeline does not care if the job runs successfully or not.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading