From 4ea80ce3b3ac2eb5ca73a1fe9e195e911f7514eb Mon Sep 17 00:00:00 2001 From: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> Date: Sat, 11 Nov 2023 19:35:12 +0100 Subject: [PATCH] check-pr: fix GitHub Action to gather the diff (#11425) --- .github/workflows/ci.yml | 2 ++ scripts/check-pr.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b151ea54b..a3d0bc3df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: actions/setup-python@v4 with: diff --git a/scripts/check-pr.sh b/scripts/check-pr.sh index ac7e72521..82c045b42 100755 --- a/scripts/check-pr.sh +++ b/scripts/check-pr.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: MIT # This script is executed by GitHub Actions for every pull request opened. -# It currently accomplishes the following objectives (for English pages only): +# It currently accomplishes the following objectives: # # 1. Detect pages that were just copied (i.e. cp pages/{common,linux}/7z.md). # 2. Detect pages that were added in a platform specific directory although @@ -50,7 +50,7 @@ function check_diff { local line local entry - git_diff=$(git diff --name-status --find-copies-harder --diff-filter=AC --relative=pages/ remotes/origin/main) + git_diff=$(git diff --name-status --find-copies-harder --diff-filter=AC origin/main -- pages*/) if [[ -n $git_diff ]]; then echo -e "Check PR: git diff:\n$git_diff" >&2