Escaped variables are passed incorrectly to child pipelines

Summary

When passing a variable containing an escaped variable to a child pipeline it is evaluated for a second time incorrectly.

Steps to reproduce

Create a variable in the parent pipeline with an escaped variable inside it:
MY_VAR: echo $$HELLO

Print the variable in the child pipeline which results in echo $

Example Project

Project: https://gitlab.com/williamoverton/child-pipeline-variable-eval

Pipeline example: https://gitlab.com/williamoverton/child-pipeline-variable-eval/-/pipelines/208788576

What is the current bug behavior?

Child pipeline incorrectly prints $ for escaped variables

What is the expected correct behavior?

The variable should not change in any way when being passed down to child pipelines.

Output of checks

This bug happens on GitLab.com

Possible fixes

User Impact

Having an escaped variable passed to child pipelines, it is not evaluated properly which can impact the functionality of the child pipeline.

Edited by Mark Nuzzo