-
Notifications
You must be signed in to change notification settings - Fork 10
48 lines (45 loc) · 1.36 KB
/
proto.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Protobuf
# Protobuf runs buf (https://buf.build/) lint and check-breakage
# This workflow is only run when a .proto file has been changed
on:
pull_request:
paths:
- "proto/**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/**.proto
**/buf.yaml
buf.work.yaml
buf.gen.yaml
- run: |
make proto-gen
if: env.GIT_DIFF
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected]
- uses: bufbuild/buf-lint-action@v1
with:
input: "proto"
break-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected]
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
# previously, this ran on ref=HEAD~1, which is incorrect as it can
# only be used to compare within a branch. it is designed to run
# on a PR, so it must compare the HEAD of the base branch against
# the PR branch.
against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},subdir=proto"