From 841819c147cb503aa02a25e137b861e38d04a7f3 Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Thu, 26 Sep 2024 07:31:18 +0200 Subject: [PATCH] SRE-2509 common: do not skip tests on empty commits ci/doc_only_change.sh shall not return 1 if it detects no changes since the last execution (or reference branch). "Doc-only: false" is no longer needed to fix this problem Signeed-off-by: Tomasz Gromadzki Required-githooks: true --- ci/doc_only_change.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ci/doc_only_change.sh b/ci/doc_only_change.sh index 1898bb27ba99..e0741952a3dd 100755 --- a/ci/doc_only_change.sh +++ b/ci/doc_only_change.sh @@ -25,5 +25,9 @@ if ! merge_base="$(git merge-base "FETCH_HEAD" HEAD)"; then # nothing to do here except exit as if it's not a doc-only change exit 0 fi +if ! git diff --no-commit-id --name-only "$merge_base" HEAD | grep -q -e ".*"; then + echo "No changes detected, full validation is expected" + exit 0 +fi git diff --no-commit-id --name-only "$merge_base" HEAD | \ - grep -v -e "^docs/" -e "\.md$" + grep -v -e "^docs/" -e "\.md$" -e "^.*LICENSE.*$"