From 71a214636d8e58768ca919c287afdc952e34b0ce Mon Sep 17 00:00:00 2001 From: Eduardo Almeida Date: Fri, 5 May 2023 00:40:23 +0000 Subject: [PATCH] ci: Fix condition to check if ".clang-tidy" file changed --- utils/tests/gitlab-ci-code-linting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/tests/gitlab-ci-code-linting.yml b/utils/tests/gitlab-ci-code-linting.yml index 8ceb968b9..7b741bfc4 100644 --- a/utils/tests/gitlab-ci-code-linting.yml +++ b/utils/tests/gitlab-ci-code-linting.yml @@ -53,7 +53,7 @@ clang-tidy: 2> /dev/null # Run full clang-tidy in the following cases: 1) default branch, 2) ".clang-tidy" file changed, 3) clang-tidy-diff had an error - - if [ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ] || (git diff -U0 --name-only upstream/$CI_DEFAULT_BRANCH | grep -q ".clang-tidy") || (egrep -q -A 3 "file not found \[clang-diagnostic-error\]" $CLANG_TIDY_OUTPUT) ; then + - if [[ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ]] || (echo $(git diff --name-only upstream/$CI_DEFAULT_BRANCH) | grep -q ".clang-tidy") || (egrep -q -A 3 "file not found \[clang-diagnostic-error\]" $CLANG_TIDY_OUTPUT) ; then echo "Running full clang-tidy" ; run-clang-tidy-14 -p cmake-cache/ -quiet 1> $CLANG_TIDY_OUTPUT