diff --git a/ci/run_clang_tidy.sh b/ci/run_clang_tidy.sh index 94169f036ed48..11d98e4c0096c 100755 --- a/ci/run_clang_tidy.sh +++ b/ci/run_clang_tidy.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eo pipefail ENVOY_SRCDIR=${ENVOY_SRCDIR:-$(cd $(dirname $0)/.. && pwd)} @@ -69,8 +69,7 @@ elif [[ "${BUILD_REASON}" != "PullRequest" ]]; then -p 1 else echo "Running clang-tidy-diff against master branch..." - git fetch https://github.com/envoyproxy/envoy.git master - git diff "${SYSTEM_PULLREQUEST_TARGETBRANCH:-refs/heads/master}..HEAD" | filter_excludes | \ + git diff "remotes/origin/${SYSTEM_PULLREQUEST_TARGETBRANCH}" | filter_excludes | \ "${LLVM_PREFIX}/share/clang/clang-tidy-diff.py" \ -clang-tidy-binary=${CLANG_TIDY} \ -p 1