From cf623d428bfd71e55c51ca441290e2e0f694d717 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sun, 18 Aug 2024 19:55:23 +0800 Subject: [PATCH] Try again --- .github/workflows/i18n-automerge.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/i18n-automerge.yml b/.github/workflows/i18n-automerge.yml index adb3d10b..5d60d5d4 100644 --- a/.github/workflows/i18n-automerge.yml +++ b/.github/workflows/i18n-automerge.yml @@ -15,6 +15,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Count lines changed run: | @@ -25,6 +27,12 @@ jobs: echo "Base SHA: $BASE_SHA" echo "Head SHA: $HEAD_SHA" + # Check if the commits exist + if ! git cat-file -e $BASE_SHA || ! git cat-file -e $HEAD_SHA; then + echo "ERROR: One or both of the commits are not available." + exit 1 + fi + # Calculate the total number of lines changed (added, removed, or modified) LINES_CHANGED=$(git diff --shortstat $BASE_SHA $HEAD_SHA | awk '{print $4 + $6 + $8}')