From 7a5b3c6bb9fc4d5c57b3f10000998d68db4393ea Mon Sep 17 00:00:00 2001
From: Timo Furrer <tfurrer@gitlab.com>
Date: Tue, 2 Jul 2024 14:35:10 +0200
Subject: [PATCH] Use commit sha instead of ref name for module tar

The ref name may include slashes indicating directories
in a filename and as such we would have to pre-created those
which we do not want. The filename does not matter,
thus, the SHA is as good.
---
 templates/module-release.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/module-release.yml b/templates/module-release.yml
index dcc7725..2d28d39 100644
--- a/templates/module-release.yml
+++ b/templates/module-release.yml
@@ -36,7 +36,7 @@ spec:
   stage: $[[ inputs.stage ]]
   image: curlimages/curl:8.8.0
   variables:
-    TAR_FILENAME: /tmp/${CI_PROJECT_NAME}-${CI_COMMIT_REF_NAME}.tgz
+    TAR_FILENAME: /tmp/${CI_PROJECT_NAME}-${CI_COMMIT_SHA}.tgz
     TF_ROOT: $[[ inputs.root_dir ]]
     UPLOAD_URL:
       ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/terraform/modules/$[[ inputs.module_name ]]/$[[ inputs.module_system ]]/$[[ inputs.module_version ]]/file
-- 
GitLab