Search code examples
gitlabgitlab-cigitlab-ci-runner

How to stop GitLab from evaluating $ inside variable value?


I am passing GitLab variable while running CI/CD pipeline as below.

type - variable
key - password
value - {"a": "abc$def@pqr"}

I am reading it in some GitLab pipeline stage as below.

echo $password

It is showing as below.

{"a":"abc@pqr"}

But I want it to show as below.

{"a":"abc$def@pqr"}

I don't want it to evaluate $def as blank

Note:

  • I tried with \ escaping and with single quotes too.
  • I need this to be in json kind of format itself for further use.

Solution

  • Works fine on using double $$ instead of single $