Use when .proto files need a CI gate or a buf failure needs debugging: buf build, buf lint (STANDARD rules), buf breaking against a git or BSR baseline, buf format, and choosing the rule category per consumer. Explains which changes break wire or generated code and why.
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Gate buf build, buf lint, and buf breaking on every PR that touches
.proto, buf.yaml, or buf.gen.yaml. All three must pass before merge.
# .github/workflows/proto-gate.yml
name: proto-gate
on:
pull_request:
paths:
- "**/*.proto"
- "buf.yaml"
- "buf.gen.yaml"
jobs:
buf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # Required for `--against ".git#branch=main"`
- uses: bufbuild/buf-setup-action@v1
with:
buf_user: ${{ secrets.BUF_USER }}
buf_api_token: ${{ secrets.BUF_API_TOKEN }}
- run: buf build
- run: buf lint
- run: buf breaking --against ".git#branch=main"Key: fetch-depth: 0 so git has the baseline commit available. fetch-depth: 1
makes buf error because it cannot reach the baseline.
The official bufbuild/buf-setup-action and bufbuild/buf-breaking-action are
convenient but the raw CLI calls above work without them.
- if: failure()
uses: marocchino/sticky-pull-request-comment@v2
with:
header: proto-gate
message: |
❌ `buf breaking` failed. See log:
```
${{ steps.breaking.outputs.stdout }}
```
Consult
references/versioning-strategy.md
for whether this change is genuinely required and how
to do it safely (reserve, add new, deprecate old).