-
Notifications
You must be signed in to change notification settings - Fork 50
33 lines (30 loc) · 1022 Bytes
/
buf-push.yaml
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
name: buf-push
on:
push:
branches:
- main
paths:
- 'proto/**'
jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# This step sets up the variable steps.buf-version.outputs.v
# to contain the version of Buf (e.g. v1.36.0) from go.mod.
- name: Get Buf version
id: buf-version
run: |
BUF_VERSION=$( go list -m -f '{{.Version}}' github.com/bufbuild/buf )
# remove the leading 'v' in front of the version
BUF_VERSION=${BUF_VERSION#v}
echo "v=$BUF_VERSION" >> "$GITHUB_OUTPUT"
- uses: bufbuild/buf-action@v1
with:
version: ${{ steps.buf-version.outputs.v }}
token: ${{ secrets.BUF_TOKEN }}
input: 'proto'
# The repository should already exist.
# If it can be automatically created, that's a sign that it was deleted,
# which is likely a major issue, which we want to be aware of.
push_disable_create: true