Restrict target branch existence check to public BuildKite pipeline.

PiperOrigin-RevId: 514942919
This commit is contained in:
Ayush Ranjan
2023-03-07 23:21:09 -08:00
committed by gVisor bot
parent 0620c3b638
commit 2d3b471daf
+7 -5
View File
@@ -1,10 +1,12 @@
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
}
if [[ "${BUILDKITE_PIPELINE_NAME:-}" == "Pipeline" ]]; then
# 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
}
fi
# Download any build-specific configuration that has been uploaded.
# This allows top-level steps to override all subsequent steps.