When you run a pipeline from the Gitlab UI, you are open to add variables to the run:
From the overview of finished pipelines, is there a way to find the set variables and values of specific runs?
As far as I know, these are one time variables you set by running a pipeline manually. You cannot view the the variables in the UI. Instead, like @Origin said you can echo the variable in the job.
example:
script:
- '& echo "$MY_VARIABLE"'
I would recommend you to save your variables in the default CI/CD Settings. (Settings -> CI/CD -> Variables). There you can set, save, protect (from other user roles) and view them for sure. These variables will be used in any pipeline run you do.
On the latest versions of Gitlab (2025 something), you can use the workflow:name property in gitlab-ci.yml to display some of your pipeline variables values directly in the pipeline Title.
For example :
workflow:
name: 'Deploy my artifact using branch=$CI_COMMIT_BRANCH and version=$MY_VERSION, choice=$MY_CHOICE'
variables:
MY_VERSION:
value: 3
description: "artifact version"
MY_CHOICE:
value: "default"
description: "your choice"
options:
- "default"
- "choice1"
- "choice2"
From my end I found it very useful.
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