The cache:key should be sanitized before using it as a path
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
I am setting the cache:key to $CI_JOB_NAME as suggested in the documentation to share the cache between branches. This fails on Windows when the job name contains a colon :, which is not allowed in Windows path names and results in the following error message from the runner:
WARNING: CreateFile ..\..\cache\git\MyProject\build_vs2022:arm64-non_protected\cache.zip: The filename, directory name, or volume label syntax is incorrect.
FATAL: mkdir ..\..\cache\git\MyProject\build_vs2022:arm64-non_protected: The directory name is invalid.
When the cache key includes sequences like ../, they are sanitized before being used as a path component. Platform specific forbidden characters (e.g., : on Windows) should probably be sanitized, similarly.
Edited by 🤖 GitLab Bot 🤖