From 8da5a918422eaf40ba2b7f4951b80d5680686821 Mon Sep 17 00:00:00 2001 From: Vladimir Reznichenko Date: Thu, 1 Aug 2024 14:18:08 +0200 Subject: [PATCH] CI: speedup 'Build Project Jobs' (#50197) In this PR, we use shallow checkout if the environment provides no base_ref, which is needed for identifying changed files. If no ref provided, we are not able to calculate the diff and therefore go with faster shallow copy. --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e878256389..97649281e49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,8 @@ jobs: - uses: 'actions/checkout@v4' name: 'Checkout' with: - fetch-depth: 0 + # If 'base_ref' is available, the 'Build Matrix' step requires non-shallow git-history to identify changed files. + fetch-depth: ${{ ( ( github.base_ref && '0' ) || '1' ) }} - uses: './.github/actions/setup-woocommerce-monorepo' name: 'Setup Monorepo' with: