diff --git a/.github/workflows/release-checks.yaml b/.github/workflows/release-checks.yaml index f6b1d683da3..45607b5f7a9 100644 --- a/.github/workflows/release-checks.yaml +++ b/.github/workflows/release-checks.yaml @@ -18,11 +18,14 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: "8.1" - - name: "Ensure that branch is up to date with main branch" + - name: "Rebase PR branch onto 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." + git config user.name "Github Actions" + git config user.email "actions@github.com" + git checkout ${{ github.event.pull_request.head.sha }} + if ! git rebase origin/main; then + echo "Failed to rebase PR branch onto main. There may be conflicts. Please resolve conflicts or rebase manually." exit 1 fi - name: "Install dependencies"