-
Notifications
You must be signed in to change notification settings - Fork 6
44 lines (36 loc) · 1.15 KB
/
buf.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
name: Buf
on:
pull_request:
push:
tags:
- v*
branches:
- develop
jobs:
buf:
runs-on: ubuntu-20.04
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup buf
uses: bufbuild/buf-setup-action@v1
- name: Lint protos
uses: bufbuild/buf-lint-action@v1
- name: Check for breaking changes (Push)
if: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v') }}
uses: bufbuild/buf-breaking-action@v1
with:
against: 'https://github.com/${{ github.repository }}.git#branch=${{ github.event.before }}'
- name: Check for breaking changes (PR)
if: github.event_name == 'pull_request'
uses: bufbuild/buf-breaking-action@v1
with:
against: 'https://github.com/${{ github.repository }}.git#branch=${{ github.base_ref }}'
- uses: bufbuild/buf-push-action@v1
if: github.event_name != 'pull_request'
with:
input: proto
buf_token: ${{ secrets.BUF_TOKEN }}
draft: ${{ !startsWith(github.ref, 'refs/tags/v') }}