-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.2 KB
/
ensure-committed-go-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
37
38
39
# Developer needs to generate files using `go generate ./...` command within
# `privacy-profile-composer/` folder. At the time of writing, specifically it
# will regenerate protobuf `.pb.go` files as specified in
# `pkg/proto/generate.go` file.
name: Ensure all `go generate` files are committed
on:
pull_request:
jobs:
generated-committed:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "privacy-profile-composer/go.mod"
- uses: arduino/setup-protoc@v3
with:
# This needs to match the version on developer's machine
version: "25.3"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: |
go mod download
go install google.golang.org/protobuf/cmd/protoc-gen-go
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
go generate ./...
working-directory: ./privacy-profile-composer
- run: |
changes=$(git status --untracked-files=no --porcelain)
if [[ -n "$changes" ]]; then
echo "=== DETECTED CHANGES ==="
echo "$changes"
git diff
exit 1
fi