From dbc280840186bd6003e0324738f88b8afa72272c Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Tue, 8 Oct 2024 17:29:24 +0200 Subject: [PATCH] SRE-2509 common: do not skip tests on empty commits (#15199) 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 Signed-off-by: Tomasz Gromadzki --- 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 1898bb27ba9..e0741952a3d 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.*$"