From eb904ec30e4b780365db426c4a3deeb4cae5b505 Mon Sep 17 00:00:00 2001 From: zaunist Date: Thu, 21 Sep 2023 09:16:29 +0000 Subject: [PATCH 1/2] ci: add GITHUB default env --- tools/src/whitenoise.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/whitenoise.sh b/tools/src/whitenoise.sh index 12d690311c1..90d02317683 100644 --- a/tools/src/whitenoise.sh +++ b/tools/src/whitenoise.sh @@ -1,7 +1,7 @@ #!/bin/bash TRAILING_WHITESPACE=0 # only check changed docs in pr -for file in $(git diff --cached --name-only --diff-filter=ACRMTU $GITHUB_BASE_REF | grep "\.md"); do +for file in $(git diff --cached --name-only --diff-filter=ACRMTU $GITHUB_BASE_REF $GITHUB_HEAD_REF | grep "\.md"); do if grep -r '[[:blank:]]$' "$1" > /dev/null; then echo "trailing whitespace: ${1}" >&2 ERRORS=yes From 180188ce9a08b036629beeb7c29a34924f46a43a Mon Sep 17 00:00:00 2001 From: zaunist Date: Thu, 21 Sep 2023 13:43:48 +0000 Subject: [PATCH 2/2] fix: whitenoise lint failed when pull request --- tools/src/whitenoise.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/src/whitenoise.sh b/tools/src/whitenoise.sh index 90d02317683..d8f351d1792 100644 --- a/tools/src/whitenoise.sh +++ b/tools/src/whitenoise.sh @@ -1,7 +1,8 @@ #!/bin/bash TRAILING_WHITESPACE=0 # only check changed docs in pr -for file in $(git diff --cached --name-only --diff-filter=ACRMTU $GITHUB_BASE_REF $GITHUB_HEAD_REF | grep "\.md"); do +git fetch +for file in $(git diff --cached --name-only --diff-filter=ACRMTU origin/$GITHUB_BASE_REF| grep "\.md"); do if grep -r '[[:blank:]]$' "$1" > /dev/null; then echo "trailing whitespace: ${1}" >&2 ERRORS=yes