-
Notifications
You must be signed in to change notification settings - Fork 3
36 lines (36 loc) · 1.15 KB
/
generate.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
34
35
36
name: generate-prtos
on:
push:
paths:
- '*.proto'
- '.github/workflows/generate.yaml'
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bufbuild/[email protected]
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Buf generate
if: success()
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go
go install github.com/v8platform/protoc-gen-go-ras
buf generate
- name: Set up Git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name GitHub
git config user.email [email protected]
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
- name: Commit and push changes
run: |
git add .
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
git commit --author "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" --message "buf generate"
git push
fi