diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f4992d9666518a5c1fa8e35fe2fb94739552877f..0a9162ed3d75c8cad555137f027f17c50929c4bf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -114,7 +114,7 @@ spack:install_compilers:
     - .spack_cache
     - .parallel_job
   script:
-    - COMPILER_LIST_SPECS=$(jq -r '.stack | .core_compiler as $core | .compilers | map("\(.spec)@\(.version) %\($core)")[]' config.json)
+    - COMPILER_LIST_SPECS=$(jq -ra '.stack | .core_compiler as $core | .compilers | map("\(.spec)@\(.version) %\($core)")[]' config.json)
     - echo "Compilers to install \n${COMPILER_LIST_SPECS}"
 
     - spack/bin/spack compiler find --scope system /usr
@@ -141,7 +141,7 @@ spack:install_compilers:
       --show-log-on-error
       ${COMPILER_LIST_SPECS}
 
-    - hashes=$(jq -r '.spec.nodes | map("/\(.hash)") | join(" ")' compilers_spec.json)
+    - hashes=$(jq -ra '.spec.nodes | map("/\(.hash)") | join(" ")' compilers_spec.json)
 
     - spack/bin/spack buildcache create
       --update-index
@@ -149,7 +149,8 @@ spack:install_compilers:
       /buildcache ${hashes}
 
     - |
-      echo 'definitions: [ compilers: [' ${COMPILER_LIST_SPECS} ']]' > compiler_definitions.yaml
+      echo 'definitions: [ compilers: ' $(jq -rac '.stack | .core_compiler as $core | .compilers | map("\(.spec)@\(.version) %\($core)")' config.json) ']' > compiler_definitions.yaml
+      cat compiler_definitions.yaml
 
     - |
       while read -r compiler