ci: fix bazel prechecks not detecting untracked changes (#56961)

This commit is contained in:
Jean-Hadrien Chabran 2023-09-22 17:34:57 +02:00 committed by GitHub
parent 86824ea3ce
commit ffb3d1c217
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,6 +34,9 @@ echo "--- :bazel: Running bazel configure"
bazel "${bazelrc[@]}" configure
echo "--- Checking if BUILD.bazel files were updated"
# Account for the possibility of a BUILD.bazel to be totally new, and thus untracked.
git ls-files --exclude-standard --others | grep BUILD.bazel | xargs git add --intent-to-add
git diff --exit-code || EXIT_CODE=$? # do not fail on non-zero exit
# if we get a non-zero exit code, bazel configure updated files