Add possibility to provide variables to MR pipelines

What does this MR do and why?

Adds the ability to provide variables when running merge request pipelines. We previously added support for inputs in MR pipelines, and now extend this to support variables as well.

References

Related to #118798 (closed)

Screenshots or screen recordings

Before After
Screenshot_2026-03-27_at_15.06.17 Screenshot_2026-03-27_at_15.06.03

How to set up and validate locally

  1. Create a merge request with a pipeline that uses variables with descriptions:

    variables:
      DEPLOY_ENV:
        description: "Target deployment environment"
    
    test:
      script:
        - echo "Running with DEPLOY_ENV=$DEPLOY_ENV"
      rules:
        - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  2. Navigate to the MR's Pipelines tab and click "Run pipeline"

  3. Add a value for the DEPLOY_ENV variable (the description will appear in the UI)

  4. Run the pipeline and verify the variable is passed correctly in the job output

See CI/CD variables documentation for more details.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Anna Vovchenko

Merge request reports

Loading
Loading