CI_PROJECT_DIR empty in when passed to downstream pipelines

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Summary

When using setting a global variable that uses $CI_PROJECT_DIR, the CI_PROJECT_DIR variable is empty when passed to downstream pipelines.

Steps to reproduce

# .gitlab-ci.yml
variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

child:
  trigger:
    include: ci/downstream.gitlab-ci.yml
    strategy: depend
    forward:
      pipeline_variables: true
# ci/downstream.gitlab-ci.yml


test:
  script:
    - echo PIP_CACHE_DIR=$PIP_CACHE_DIR

Example Project

What is the current bug behavior?

Job outputs:

PIP_CACHE_DIR=/.cache/pip

What is the expected correct behavior?

PIP_CACHE_DIR=/builds/example/project/.cache/pip

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

GitLab v15.11 gitlab-runner v15.11

Results of GitLab application Check

N/A

Possible fixes

Edited Sep 27, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading