From a564a085affabbcfe702f53a28041709801e5183 Mon Sep 17 00:00:00 2001 From: hectorhammett Date: Tue, 5 May 2026 19:53:51 +0000 Subject: [PATCH] Add an early fail to the breaking change detector if the pr branch is out of sync with main --- .github/workflows/release-checks.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release-checks.yaml b/.github/workflows/release-checks.yaml index e1c9cd84281..8ac4b174147 100644 --- a/.github/workflows/release-checks.yaml +++ b/.github/workflows/release-checks.yaml @@ -18,6 +18,13 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: "8.1" + - name: "Ensure that branch is up to date with main branch" + if: github.event.pull_request.user.login != 'release-please[bot]' + run: | + if ! git merge-base --is-ancestor origin/main ${{ github.event.pull_request.head.sha }}; then + echo "PR branch is out of date with main. Please merge or rebase main into your branch to avoid false BC break detections." + exit 1 + fi - name: "Install dependencies" run: composer global require "roave/backward-compatibility-check:^8.2" - name: "Check for BC breaks"