Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ jobs:
env:
EVENT: ${{ github.event_name }}
BEFORE_SHA: ${{ github.event.before }}
# merge_group has no `before`; its payload carries the queue base.
MERGE_BASE_SHA: ${{ github.event.merge_group.base_sha }}
HEAD_SHA: ${{ github.sha }}
BASE_REF: ${{ github.base_ref }}
run: |
Expand Down Expand Up @@ -194,6 +196,24 @@ jobs:
run_all=true
fi
;;
merge_group)
# `github.event.before` does not exist on merge_group, so without
# this branch every queue entry fell through to the default arm
# and rebuilt all 24 rows regardless of what the pull request
# touched. The queue head is the base plus the queued commits, so
# diffing from base_sha yields exactly those changes (and, for a
# batched entry, every pull request in the batch).
if [ -z "${MERGE_BASE_SHA}" ]; then
echo "merge_group base_sha missing; running full matrix"
run_all=true
elif ! git rev-parse --verify -q "${MERGE_BASE_SHA}^{commit}" >/dev/null 2>&1; then
echo "merge_group base ${MERGE_BASE_SHA} not in history; running full matrix"
run_all=true
elif ! changed=$(git diff --name-only "${MERGE_BASE_SHA}...${HEAD_SHA}" 2>/dev/null); then
echo "diff ${MERGE_BASE_SHA}...${HEAD_SHA} failed; running full matrix"
run_all=true
fi
;;
*)
if [ -z "${BEFORE_SHA}" ] || [ "${BEFORE_SHA}" = "0000000000000000000000000000000000000000" ]; then
run_all=true
Expand Down
Loading