Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the results (succeeded or failed) of previous stages/jobs in a pipeline of GitLab CI?

In one pipeline there are multiple stages. How can I get the results (succeeded or failed) of previous stages/jobs in the last stage/job of a pipeline?

like image 736
Hank Chow Avatar asked Oct 15 '25 14:10

Hank Chow


1 Answers

One way is to use the gitlab-ci job api to find the status from its response; However, depending on your use case; you can also use CI_JOB_STATUS in the 'after_script` of the same job.

You can use a custom variable as a flag, that you can set in the after script of the same job based on CI_JOB_STATUS.

Note: CI_JOB_STATUS can be success, failed, or canceled

like image 124
Kaish kugashia Avatar answered Oct 17 '25 18:10

Kaish kugashia



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!