Skip to content

GitLab Next

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLab FOSSGitLab FOSS
  • Issues
  • #45173
Closed
Open
Created Apr 09, 2018 by Jonas Schmid@jonas.schmid

Secret variables with a dollar sign are not correctly set

Summary

When a secret variable contains a dollar sign $, the secret variable is not set correctly. It seems the content after the dollar sign is expended as it was a variable.

I did not see documentation stating that this is the expected behavior.

Steps to reproduce

  • Create a new repo
  • Setup the repo with a new secret variable: `TEST=hello$world``
  • Create a new .gitlab-ci.yml that contains
test:
  stage: test
    - env
  • Push random code to run the CI step
  • The content of the job will be TEST=hello

Example Project

None

What is the current bug behavior?

The content of the job will be TEST=hello

What is the expected correct behavior?

The content of the job sould be TEST=hello$world

Workaround

In the variable value, use a double dollar sign instead of a single: TEST=hello$$world instead of TEST=hello$world

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
Sorry, I don't have access to the Gitlab instance

Results of GitLab application Check

Expand for output related to the GitLab application check
Sorry, I don't have access to the Gitlab instance

Possible fixes

Edited Dec 04, 2018 by Elliot Rushton
Assignee
Assign to
Time tracking