CI/CD: CI_PROJECT_DIR variable uses wrong/invalid path separator character in GitLab Runner for Windows

Summary

GitLab CI/CD variables containing file paths are forwarded to scripts contained in .gitlab-ci.yml script sections as-is.

However, for GitLab Runner for Windows, the variable values' path separator character must be changed in all the variable values from "/" to "\" before being forwarded to GitLab Runner for Windows. Otherwise, GitLab Runner for Windows execution fails.

Steps to reproduce

after_script:
  - XCOPY "C:\Some\Output\*.xml" "%CI_PROJECT_DIR%\xUnit-Reports\" /Y /I

What is the current bug behavior?

Scripts executed by GitLab Runner for Windows fail due to incorrect file path separator characters in GitLab CI/CD variable values.


What is the expected correct behavior?

GitLab CI/CD should replace all "/" characters in GitLab CI/CD variable values containing paths with the "\" character for all variables forwarded to GitLab Runner for Windows.

Edited by A. D.