Cache🔑files no variables allowed

Problem to solve

I’m trying to cache files but the location of the files is configurable.
If I use something like $VARIABLE/file, it does not locate the file.
It still says the pipeline is valid, the hash is just empty.

Steps to reproduce

  1. Configure CI as below.
  2. Observe the name of the cache file

Configuration

Sample configuration with CI jobs run

missing_job:
  # Create a file to be cached
  script:
    - touch cached-dir/bar
  cache:
    # Cache our "dynamic" file
    paths:
    - cached-dir
    key:
      files:
        # Allow configuration of the keying file location
      - $DIRECTORY/foo

Versions

Helpful resources

Reason for doing