Using file-variable in gitlab-ci.yml results in string instead of file-path

Summary

If I try passing a file-variable through another variable the content gets passed instead of the file

Steps to reproduce

  1. Add a file variable in Settings => CI/CD => Variables
  2. Try passing the name as content:
#!gitlab-ci.yml
---
stages:
  - test

.template: &template
  stage: test
  image: bash
  variables:
    ADDITIONAL_FILES: "/usr/bin/env"
  script:
    - set -x
    - test -f "${ADDITIONAL_FILES}"
    - test -f "${SECRET_FILE}"


file passing success:
  extends: .template


file passing failure:
  extends: .template
  variables:
    ADDITIONAL_FILES: "${SECRET_FILE}"

Example Project

https://gitlab.com/norpol/gitlab-manual-parallel/-/blob/70d711bf64a49f06ce2c0a2050f9256055bfb5f6/.gitlab-ci.yml

https://gitlab.com/norpol/gitlab-manual-parallel/-/pipelines/370460294

What is the current bug behavior?

File is rendered as a string instead of a path to the file

What is the expected correct behavior?

Variable should still point to a file instead of being rendered

Relevant logs and/or screenshots

image image

image

Output of checks

This bug happens on GitLab.com