buildkite: don't run tests on deleted branches

Copybara updates a target branch before merging it to the master
and then it deletes it. The problem is that it triggers buildkite
twice on the same commit: on the master branch and on
the target branch.

PiperOrigin-RevId: 514573062
This commit is contained in:
Andrei Vagin
2023-03-06 17:31:10 -08:00
committed by gVisor bot
parent eb5b888d97
commit 46c375f460
+6
View File
@@ -1,5 +1,11 @@
set -euo pipefail
# Check that the target branch exists.
git fetch origin "${BUILDKITE_BRANCH}" || {
echo "Branch ${BUILDKITE_BRANCH} no longer exists; it was probably deleted by the time we got to it." >&2
exit 1
}
# Download any build-specific configuration that has been uploaded.
# This allows top-level steps to override all subsequent steps.
buildkite-agent artifact download 'tools/bazeldefs/*' . || true