From 7f89bf481142b9e14b0505c6815cdbb119d8baca Mon Sep 17 00:00:00 2001 From: Conor Schaefer Date: Wed, 8 Nov 2023 14:46:34 -0800 Subject: [PATCH] ci: only run buf lint on PRs against main Also ensures we're using the most recent stable version of buf across all workflows, via the `v1` version specifier. Closes #3292. (cherry picked from commit 78a85fd8b74c8aee45e59dd72a9649d49700396f) --- .github/workflows/buf-pull-request.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buf-pull-request.yml b/.github/workflows/buf-pull-request.yml index 4593874e18..478d9cf44f 100644 --- a/.github/workflows/buf-pull-request.yml +++ b/.github/workflows/buf-pull-request.yml @@ -1,5 +1,11 @@ name: Protobuf -on: pull_request +on: + # Exclude feature branches, only run if the PR is targeting main. + pull_request_target: + types: + - opened + branches: + - "main" jobs: lint: name: Lint protobuf @@ -55,7 +61,7 @@ jobs: toolchain: stable override: false - - uses: bufbuild/buf-setup-action@v1.27.1 + - uses: bufbuild/buf-setup-action@v1 with: buf_api_token: ${{ secrets.BUF_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}