Skip to content

adds the CI_FAILED_STAGE variable indicating the stage that failed the pipeline for an `when: on_failure` job

What does this MR do?

This MR adds the environment variables CI_STATE_JOB_XYZ and CI_STATE_STAGE_XYZ for each job / stage and as the value of each job / stage resp.

ex:

export CI_STATE_JOB_TEST=success
export CI_STATE_STAGE_TESTING=pending

Sanitization

The job name or stage name is less limited in terms of allowed characters as opposed to environment variables, so the name will be sanitized by the following rules:

  • all characters are uppercased
  • one or more spaces are replaced by one single _
  • any other character than A to Z and 0 to 9, _ are removed.

Are there points in the code the reviewer needs to double check?

  • please check the correct gitlab version number in the docs

Why was this MR needed?

It fixes #35229 (moved) .

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

#35229 (moved)

Edited by Christiaan Van den Poel

Merge request reports