How to include file with predefined variable's reference in pipeline

I am trying to include a yml file to another in my pipeline, this way:

  - project: 'somepath/path'
    ref: '$CI_COMMIT_REF_NAME'
    file: '/.myfile.yml'

but it doesn’t work for me, I expected to return just branch name

I found this issue : Support additional variables in the include field (#337633) · Issues · / GitLab · GitLab
Predefined variable $CI_COMMIT_REF_NAME return refs/heads/master insead of master branch.
Do you have any suggestion how can I include file with CI_COMMIT_REF_NAME reference?

1 Like