diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml index a993293d4..cc7629534 100644 --- a/.github/workflows/buf.yml +++ b/.github/workflows/buf.yml @@ -27,7 +27,22 @@ jobs: push: false archive: false pr_comment: false - build: false lint: false format: false - breaking: true + # A push that creates a branch carries no `before` commit, so the + # action's default baseline is the all-zero SHA and `buf breaking` + # dies cloning it. Skipping costs nothing: every commit on a freshly + # cut release branch should have already passed this check on main. + breaking: ${{ !github.event.created }} + # The alternative is to compare against the default branch instead of + # skipping. Not used: buf clones the baseline when the job runs, so a + # main that has moved on since the branch was cut reads as protos + # deleted on the release branch. Resolving to an empty string on every + # other event is what keeps the action's own default in place, which + # stacked pull requests need. + # breaking_against: >- + # ${{ github.event.created + # && format('{0}#format=git,branch={1}', + # github.event.repository.clone_url, + # github.event.repository.default_branch) + # || '' }}