diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 449449672f96e16105bcf5d928e87fd864b4eeb1..d0f318e11054950d1ba10c400d789865f44f46f7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -102,7 +102,7 @@ spack:install_compilers:
       --use-cache
       ${COMPILER_LIST_SPECS}
 
-    - echo "definitions: [ compilers: [ ${COMPILER_LIST_SPECS} ]]" > compiler_definitions.yaml
+    - echo "definitions: \[ compilers: \[ ${COMPILER_LIST_SPECS} \]\]" > compiler_definitions.yaml
 
     - /spack/spack/bin/spack compiler find --scope site /usr