Skip to content

Add support for variables for the manual confirmation modal

What does this MR do and why?

This MR adds support for expanding CI/CD variables in manual job confirmation messages. When a job is configured with when: manual and manual_confirmation, the confirmation message will now properly replace variable references like $VARIABLE_NAME with their actual values.

References

This MR resolves Add support for user defined variables for the ... (#468971)

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

Create a .gitlab-ci.yml file with this content:

variables:
 GLOBAL_VAR: "A global variable value"

stages:
 - test

manual-job:
 stage: test
 variables:
   JOB_VAR: "A job-specific variable"
 script:
   - echo "This is a test job"
 when: manual
 manual_confirmation: "Testing variables expansion: $GLOBAL_VAR and $JOB_VAR"
  1. Commit this file to a GitLab repository you have access to.
  2. You should see a pipeline with a manual job. Click the play button (▶️) on the job.
  3. A confirmation dialog should appear. If your implementation is working correctly, you should see: Custom confimation message: Testing variables expansion: A global variable value and A job-specific variable

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.

Related to #468971

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading