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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With