From a68dd6bab9fbb91418dd202bd75d076715416ca4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9E=97=E5=8D=9A=E4=BB=81=28Buo-ren=20Lin=29?=
 <buo.ren.lin@gmail.com>
Date: Sun, 27 Oct 2024 15:41:53 +0800
Subject: [PATCH] fix(github-actions/release): Limit fetch depth to reduce
 submodule checkout time
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: ๆž—ๅšไป(Buo-ren Lin) <buo.ren.lin@gmail.com>
---
 .github/workflows/release.yml | 3 ++-
 .gitlab-ci.yml                | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 635e687..12dddb0 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -49,7 +49,8 @@ jobs:
         run: |-
           git submodule update \
             --init \
-            --recursive
+            --recursive \
+            --depth 1
 
       - name: Determine the project identifier
         run: printf "project_id=${GITHUB_REPOSITORY##*/}\\n" >> $GITHUB_ENV
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2b641f3..2c08438 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,6 +10,9 @@
 variables:
   GIT_SUBMODULE_STRATEGY: recursive
 
+  # Limit fetch depth to reduce submodule checkout time
+  GIT_SUBMODULE_DEPTH: 1
+
 do-static-analysis:
   stage: test
   rules: