From 1da5241ef76f2c6164ed7335d8a64b44e191a191 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 8 Feb 2024 13:59:15 -0700 Subject: [PATCH] Try to buf harder (#7591) Release Notes: - N/A --- .github/workflows/ci.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61c0d50296..c18cc38e6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,15 +49,22 @@ jobs: uses: ./.github/actions/check_style - name: Ensure fresh merge + shell: bash -euxo pipefail {0} run: | - git checkout -B temp - git merge -q origin/main -m "merge main into temp" + if [ -z "$GITHUB_BASE_REF" ]; + then + echo "BUF_BASE_BRANCH=$(git merge-base origin/main HEAD)" >> $GITHUB_ENV + else + git checkout -B temp + git merge -q origin/$GITHUB_BASE_REF -m "merge main into temp" + echo "BUF_BASE_BRANCH=$GITHUB_BASE_REF" >> $GITHUB_ENV + fi - uses: bufbuild/buf-setup-action@v1 - uses: bufbuild/buf-breaking-action@v1 with: input: "crates/rpc/proto/" - against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=main,subdir=crates/rpc/proto/" + against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=${BUF_BASE_BRANCH},subdir=crates/rpc/proto/" macos_tests: name: (macOS) Run Clippy and tests